{"version":3,"file":"index-d095ad58.js","sources":["../../node_modules/react/cjs/react.production.min.js","../../node_modules/react/index.js","../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/scheduler/cjs/scheduler.production.min.js","../../node_modules/scheduler/index.js","../../node_modules/react-dom/cjs/react-dom.production.min.js","../../node_modules/react-dom/index.js","../../node_modules/react-dom/client.js","../../node_modules/antd/node_modules/classnames/index.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/antd/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/antd/node_modules/react-is/index.js","../../node_modules/antd/node_modules/rc-util/es/Children/toArray.js","../../node_modules/antd/node_modules/rc-util/es/warning.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/antd/node_modules/rc-util/es/Dom/findDOMNode.js","../../node_modules/antd/node_modules/rc-util/es/hooks/useMemo.js","../../node_modules/antd/node_modules/rc-util/es/ref.js","../../node_modules/antd/node_modules/rc-resize-observer/es/Collection.js","../../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","../../node_modules/antd/node_modules/rc-resize-observer/es/utils/observerUtil.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/inherits.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/antd/node_modules/rc-resize-observer/node_modules/@babel/runtime/helpers/esm/createSuper.js","../../node_modules/antd/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js","../../node_modules/antd/node_modules/rc-resize-observer/es/SingleObserver/index.js","../../node_modules/antd/node_modules/rc-resize-observer/es/index.js","../../node_modules/antd/node_modules/rc-util/es/omit.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/antd/node_modules/rc-util/es/raf.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/@emotion/hash/dist/hash.browser.esm.js","../../node_modules/@ant-design/cssinjs/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/@ant-design/cssinjs/node_modules/rc-util/es/Dom/contains.js","../../node_modules/@ant-design/cssinjs/node_modules/rc-util/es/Dom/dynamicCSS.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/@ant-design/cssinjs/es/Cache.js","../../node_modules/@ant-design/cssinjs/es/StyleContext.js","../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/inherits.js","../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/esm/createSuper.js","../../node_modules/@ant-design/cssinjs/es/theme/calc/calculator.js","../../node_modules/@ant-design/cssinjs/es/theme/calc/CSSCalculator.js","../../node_modules/@ant-design/cssinjs/es/theme/calc/NumCalculator.js","../../node_modules/@ant-design/cssinjs/es/theme/calc/index.js","../../node_modules/@ant-design/cssinjs/es/theme/ThemeCache.js","../../node_modules/@ant-design/cssinjs/es/theme/Theme.js","../../node_modules/@ant-design/cssinjs/es/theme/createTheme.js","../../node_modules/@ant-design/cssinjs/es/util/index.js","../../node_modules/@ant-design/cssinjs/es/util/css-variables.js","../../node_modules/@ant-design/cssinjs/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.js","../../node_modules/@ant-design/cssinjs/es/hooks/useEffectCleanupRegister.js","../../node_modules/@ant-design/cssinjs/es/hooks/useGlobalCache.js","../../node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@emotion/unitless/dist/unitless.browser.esm.js","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Parser.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/@ant-design/cssinjs/es/util/cacheMapUtil.js","../../node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js","../../node_modules/@ant-design/cssinjs/es/hooks/useCSSVarRegister.js","../../node_modules/@ant-design/cssinjs/es/extractStyle.js","../../node_modules/@ant-design/cssinjs/es/Keyframes.js","../../node_modules/@ant-design/cssinjs/es/transformers/legacyLogicalProperties.js","../../node_modules/antd/node_modules/@ant-design/icons/es/components/Context.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toArray.js","../../node_modules/antd/node_modules/rc-util/es/utils/get.js","../../node_modules/antd/node_modules/rc-util/es/utils/set.js","../../node_modules/antd/es/_util/warning.js","../../node_modules/antd/es/form/validateMessagesContext.js","../../node_modules/rc-pagination/es/locale/en_US.js","../../node_modules/rc-picker/es/locale/en_US.js","../../node_modules/antd/es/time-picker/locale/en_US.js","../../node_modules/antd/es/date-picker/locale/en_US.js","../../node_modules/antd/es/locale/en_US.js","../../node_modules/antd/es/modal/locale.js","../../node_modules/antd/es/locale/context.js","../../node_modules/antd/es/locale/useLocale.js","../../node_modules/antd/es/locale/index.js","../../node_modules/@ctrl/tinycolor/dist/module/util.js","../../node_modules/@ctrl/tinycolor/dist/module/conversion.js","../../node_modules/@ctrl/tinycolor/dist/module/css-color-names.js","../../node_modules/@ctrl/tinycolor/dist/module/format-input.js","../../node_modules/@ctrl/tinycolor/dist/module/index.js","../../node_modules/antd/node_modules/@ant-design/colors/es/generate.js","../../node_modules/antd/node_modules/@ant-design/colors/es/index.js","../../node_modules/antd/es/theme/themes/seed.js","../../node_modules/antd/es/theme/themes/shared/genColorMapToken.js","../../node_modules/antd/es/theme/themes/shared/genRadius.js","../../node_modules/antd/es/theme/themes/shared/genCommonMapToken.js","../../node_modules/antd/es/theme/themes/shared/genControlHeight.js","../../node_modules/antd/es/theme/themes/shared/genFontSizes.js","../../node_modules/antd/es/theme/themes/shared/genFontMapToken.js","../../node_modules/antd/es/theme/themes/shared/genSizeMapToken.js","../../node_modules/antd/es/theme/themes/default/colorAlgorithm.js","../../node_modules/antd/es/theme/themes/default/colors.js","../../node_modules/antd/es/theme/themes/default/index.js","../../node_modules/antd/es/theme/context.js","../../node_modules/antd/es/config-provider/context.js","../../node_modules/antd/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/antd/node_modules/rc-util/es/Dom/contains.js","../../node_modules/antd/node_modules/rc-util/es/Dom/dynamicCSS.js","../../node_modules/antd/es/config-provider/cssVariables.js","../../node_modules/antd/es/config-provider/DisabledContext.js","../../node_modules/antd/es/config-provider/SizeContext.js","../../node_modules/antd/es/config-provider/hooks/useConfig.js","../../node_modules/antd/node_modules/rc-util/es/isEqual.js","../../node_modules/antd/es/theme/interface/presetColors.js","../../node_modules/antd/es/version/version.js","../../node_modules/antd/es/theme/util/getAlphaColor.js","../../node_modules/antd/es/theme/util/alias.js","../../node_modules/antd/es/theme/useToken.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/antd/node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/antd/es/_util/hooks/useUniqueMemo.js","../../node_modules/antd/node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/antd/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/antd/node_modules/rc-util/es/hooks/useState.js","../../node_modules/antd/node_modules/rc-util/es/hooks/useMergedState.js","../../node_modules/antd/es/style/operationUnit.js","../../node_modules/antd/es/style/index.js","../../node_modules/antd/es/theme/util/maxmin.js","../../node_modules/antd/es/theme/util/statistic.js","../../node_modules/antd/es/theme/util/useResetIconStyle.js","../../node_modules/antd/es/theme/util/genComponentStyleHook.js","../../node_modules/antd/es/theme/util/genPresetColor.js","../../node_modules/antd/es/config-provider/hooks/useThemeKey.js","../../node_modules/antd/es/config-provider/hooks/useTheme.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/antd/node_modules/rc-motion/node_modules/classnames/index.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/antd/node_modules/rc-motion/es/context.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/inherits.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/createSuper.js","../../node_modules/antd/node_modules/rc-motion/es/DomWrapper.js","../../node_modules/antd/node_modules/rc-util/es/hooks/useSyncState.js","../../node_modules/antd/node_modules/rc-motion/es/interface.js","../../node_modules/antd/node_modules/rc-motion/es/util/motion.js","../../node_modules/antd/node_modules/rc-motion/es/hooks/useDomMotionEvents.js","../../node_modules/antd/node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js","../../node_modules/antd/node_modules/rc-motion/es/hooks/useNextFrame.js","../../node_modules/antd/node_modules/rc-motion/es/hooks/useStepQueue.js","../../node_modules/antd/node_modules/rc-motion/es/hooks/useStatus.js","../../node_modules/antd/node_modules/rc-motion/es/CSSMotion.js","../../node_modules/antd/node_modules/rc-motion/node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/antd/node_modules/rc-motion/es/util/diff.js","../../node_modules/antd/node_modules/rc-motion/es/CSSMotionList.js","../../node_modules/antd/es/config-provider/MotionWrapper.js","../../node_modules/antd/es/config-provider/PropWarning.js","../../node_modules/antd/es/config-provider/index.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CheckCircleFilled.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/classnames/index.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@ctrl/tinycolor/dist/module/util.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@ctrl/tinycolor/dist/module/conversion.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@ctrl/tinycolor/dist/module/format-input.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@ant-design/colors/es/generate.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@ant-design/colors/es/index.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/rc-util/es/Dom/contains.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/rc-util/es/Dom/dynamicCSS.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/rc-util/es/Dom/shadow.js","../../node_modules/antd/node_modules/@ant-design/icons/node_modules/rc-util/es/warning.js","../../node_modules/antd/node_modules/@ant-design/icons/es/utils.js","../../node_modules/antd/node_modules/@ant-design/icons/es/components/IconBase.js","../../node_modules/antd/node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js","../../node_modules/antd/node_modules/@ant-design/icons/es/components/AntdIcon.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CheckCircleFilled.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CloseCircleFilled.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CloseOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CloseOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleFilled.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/ExclamationCircleFilled.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/InfoCircleFilled.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/InfoCircleFilled.js","../../node_modules/antd/node_modules/rc-util/es/pickAttrs.js","../../node_modules/antd/es/_util/reactNode.js","../../node_modules/compute-scroll-into-view/dist/index.js","../../node_modules/scroll-into-view-if-needed/dist/index.js","../../node_modules/antd/es/_util/getScroll.js","../../node_modules/antd/es/_util/easings.js","../../node_modules/antd/es/_util/scrollTo.js","../../node_modules/antd/es/config-provider/hooks/useCSSVarCls.js","../../node_modules/classnames/index.js","../../node_modules/rc-notification/node_modules/rc-motion/node_modules/rc-util/es/Dom/findDOMNode.js","../../node_modules/rc-notification/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/rc-notification/node_modules/react-is/index.js","../../node_modules/rc-notification/node_modules/rc-motion/node_modules/rc-util/es/ref.js","../../node_modules/rc-notification/node_modules/rc-motion/es/context.js","../../node_modules/rc-notification/node_modules/rc-motion/es/DomWrapper.js","../../node_modules/rc-notification/node_modules/rc-motion/node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/rc-notification/node_modules/rc-motion/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/rc-notification/node_modules/rc-motion/node_modules/rc-util/es/hooks/useState.js","../../node_modules/@babel/runtime/helpers/esm/toArray.js","../../node_modules/rc-notification/node_modules/rc-motion/node_modules/rc-util/es/hooks/useSyncState.js","../../node_modules/rc-notification/node_modules/rc-motion/es/interface.js","../../node_modules/rc-notification/node_modules/rc-motion/es/util/motion.js","../../node_modules/rc-notification/node_modules/rc-motion/es/hooks/useDomMotionEvents.js","../../node_modules/rc-notification/node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js","../../node_modules/rc-notification/node_modules/rc-motion/node_modules/rc-util/es/raf.js","../../node_modules/rc-notification/node_modules/rc-motion/es/hooks/useNextFrame.js","../../node_modules/rc-notification/node_modules/rc-motion/es/hooks/useStepQueue.js","../../node_modules/rc-notification/node_modules/rc-motion/es/hooks/useStatus.js","../../node_modules/rc-notification/node_modules/rc-motion/es/CSSMotion.js","../../node_modules/rc-notification/node_modules/rc-motion/es/util/diff.js","../../node_modules/rc-notification/node_modules/rc-motion/es/CSSMotionList.js","../../node_modules/rc-util/es/KeyCode.js","../../node_modules/rc-util/es/pickAttrs.js","../../node_modules/rc-notification/es/Notice.js","../../node_modules/rc-notification/es/NotificationProvider.js","../../node_modules/rc-notification/es/hooks/useStack.js","../../node_modules/rc-notification/es/NoticeList.js","../../node_modules/rc-notification/es/Notifications.js","../../node_modules/rc-notification/es/hooks/useNotification.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/LoadingOutlined.js","../../node_modules/antd/es/_util/zindexContext.js","../../node_modules/antd/es/_util/hooks/useZIndex.js","../../node_modules/antd/es/message/style/index.js","../../node_modules/antd/es/message/PurePanel.js","../../node_modules/antd/es/message/util.js","../../node_modules/antd/es/message/useMessage.js","../../node_modules/antd/es/_util/hooks/usePatchElement.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js","../../node_modules/antd/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","../../node_modules/antd/node_modules/rc-util/es/React/render.js","../../node_modules/antd/es/_util/motion.js","../../node_modules/antd/node_modules/rc-util/es/Dom/isVisible.js","../../node_modules/antd/es/_util/wave/style.js","../../node_modules/antd/es/_util/wave/interface.js","../../node_modules/antd/es/_util/wave/util.js","../../node_modules/antd/es/_util/wave/WaveEffect.js","../../node_modules/antd/es/_util/wave/useWave.js","../../node_modules/antd/es/_util/wave/index.js","../../node_modules/antd/es/config-provider/hooks/useSize.js","../../node_modules/antd/es/space/style/compact.js","../../node_modules/antd/es/space/style/index.js","../../node_modules/antd/es/space/Compact.js","../../node_modules/antd/es/button/button-group.js","../../node_modules/antd/es/button/buttonHelpers.js","../../node_modules/antd/es/button/IconWrapper.js","../../node_modules/antd/es/button/LoadingIcon.js","../../node_modules/antd/es/button/style/group.js","../../node_modules/antd/es/button/style/token.js","../../node_modules/antd/es/button/style/index.js","../../node_modules/antd/es/style/compact-item.js","../../node_modules/antd/es/style/compact-item-vertical.js","../../node_modules/antd/es/button/style/compactCmp.js","../../node_modules/antd/es/button/button.js","../../node_modules/antd/es/_util/ActionButton.js","../../node_modules/antd/es/modal/context.js","../../node_modules/antd/es/modal/components/ConfirmCancelBtn.js","../../node_modules/antd/es/modal/components/ConfirmOkBtn.js","../../node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/rc-util/es/warning.js","../../node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/react-is/index.js","../../node_modules/rc-util/es/hooks/useMemo.js","../../node_modules/rc-util/es/ref.js","../../node_modules/@rc-component/portal/es/Context.js","../../node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/@rc-component/portal/es/useDom.js","../../node_modules/rc-util/es/Dom/contains.js","../../node_modules/rc-util/es/Dom/dynamicCSS.js","../../node_modules/rc-util/es/getScrollBarSize.js","../../node_modules/@rc-component/portal/es/util.js","../../node_modules/@rc-component/portal/es/useScrollLocker.js","../../node_modules/@rc-component/portal/es/mock.js","../../node_modules/@rc-component/portal/es/Portal.js","../../node_modules/rc-dialog/es/context.js","../../node_modules/rc-util/es/hooks/useId.js","../../node_modules/rc-dialog/es/util.js","../../node_modules/rc-util/es/Dom/findDOMNode.js","../../node_modules/rc-motion/es/context.js","../../node_modules/rc-motion/es/DomWrapper.js","../../node_modules/rc-util/es/hooks/useState.js","../../node_modules/rc-motion/es/interface.js","../../node_modules/rc-motion/es/util/motion.js","../../node_modules/rc-motion/es/hooks/useDomMotionEvents.js","../../node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js","../../node_modules/rc-util/es/raf.js","../../node_modules/rc-motion/es/hooks/useNextFrame.js","../../node_modules/rc-motion/es/hooks/useStepQueue.js","../../node_modules/rc-motion/es/hooks/useStatus.js","../../node_modules/rc-motion/es/CSSMotion.js","../../node_modules/rc-motion/es/util/diff.js","../../node_modules/rc-motion/es/CSSMotionList.js","../../node_modules/rc-dialog/es/Dialog/Content/MemoChildren.js","../../node_modules/rc-dialog/es/Dialog/Content/Panel.js","../../node_modules/rc-dialog/es/Dialog/Content/index.js","../../node_modules/rc-dialog/es/Dialog/Mask.js","../../node_modules/rc-dialog/es/Dialog/index.js","../../node_modules/rc-dialog/es/DialogWrap.js","../../node_modules/antd/es/_util/hooks/useClosable.js","../../node_modules/antd/node_modules/rc-util/es/Dom/styleChecker.js","../../node_modules/antd/es/_util/styleChecker.js","../../node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js","../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","../../node_modules/rc-util/es/Children/toArray.js","../../node_modules/rc-util/es/isEqual.js","../../node_modules/rc-field-form/es/FieldContext.js","../../node_modules/rc-field-form/es/ListContext.js","../../node_modules/rc-field-form/es/utils/typeUtil.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/@rc-component/async-validator/es/messages.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/inherits.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/createSuper.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/construct.js","../../node_modules/@rc-component/async-validator/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","../../node_modules/@rc-component/async-validator/es/util.js","../../node_modules/@rc-component/async-validator/es/rule/enum.js","../../node_modules/@rc-component/async-validator/es/rule/pattern.js","../../node_modules/@rc-component/async-validator/es/rule/range.js","../../node_modules/@rc-component/async-validator/es/rule/required.js","../../node_modules/@rc-component/async-validator/es/rule/url.js","../../node_modules/@rc-component/async-validator/es/rule/type.js","../../node_modules/@rc-component/async-validator/es/rule/whitespace.js","../../node_modules/@rc-component/async-validator/es/rule/index.js","../../node_modules/@rc-component/async-validator/es/validator/any.js","../../node_modules/@rc-component/async-validator/es/validator/array.js","../../node_modules/@rc-component/async-validator/es/validator/boolean.js","../../node_modules/@rc-component/async-validator/es/validator/date.js","../../node_modules/@rc-component/async-validator/es/validator/enum.js","../../node_modules/@rc-component/async-validator/es/validator/float.js","../../node_modules/@rc-component/async-validator/es/validator/integer.js","../../node_modules/@rc-component/async-validator/es/validator/method.js","../../node_modules/@rc-component/async-validator/es/validator/number.js","../../node_modules/@rc-component/async-validator/es/validator/object.js","../../node_modules/@rc-component/async-validator/es/validator/pattern.js","../../node_modules/@rc-component/async-validator/es/validator/regexp.js","../../node_modules/@rc-component/async-validator/es/validator/required.js","../../node_modules/@rc-component/async-validator/es/validator/string.js","../../node_modules/@rc-component/async-validator/es/validator/type.js","../../node_modules/@rc-component/async-validator/es/validator/index.js","../../node_modules/@rc-component/async-validator/es/index.js","../../node_modules/rc-field-form/es/utils/messages.js","../../node_modules/rc-util/es/utils/get.js","../../node_modules/rc-util/es/utils/set.js","../../node_modules/rc-field-form/es/utils/validateUtil.js","../../node_modules/rc-field-form/es/utils/valueUtil.js","../../node_modules/rc-field-form/es/Field.js","../../node_modules/rc-field-form/es/List.js","../../node_modules/rc-field-form/es/utils/asyncUtil.js","../../node_modules/rc-field-form/es/utils/NameMap.js","../../node_modules/rc-field-form/es/useForm.js","../../node_modules/rc-field-form/es/FormContext.js","../../node_modules/rc-field-form/es/Form.js","../../node_modules/rc-field-form/es/useWatch.js","../../node_modules/rc-field-form/es/index.js","../../node_modules/antd/es/form/context.js","../../node_modules/antd/es/skeleton/Element.js","../../node_modules/antd/es/skeleton/style/index.js","../../node_modules/antd/es/skeleton/Avatar.js","../../node_modules/antd/es/skeleton/Button.js","../../node_modules/antd/es/skeleton/Image.js","../../node_modules/antd/es/skeleton/Input.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/DotChartOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/DotChartOutlined.js","../../node_modules/antd/es/skeleton/Node.js","../../node_modules/antd/es/skeleton/Paragraph.js","../../node_modules/antd/es/skeleton/Title.js","../../node_modules/antd/es/skeleton/Skeleton.js","../../node_modules/antd/es/watermark/context.js","../../node_modules/antd/es/modal/components/NormalCancelBtn.js","../../node_modules/antd/es/modal/components/NormalOkBtn.js","../../node_modules/antd/es/modal/shared.js","../../node_modules/antd/es/style/motion/collapse.js","../../node_modules/antd/es/style/motion/motion.js","../../node_modules/antd/es/style/motion/fade.js","../../node_modules/antd/es/style/motion/move.js","../../node_modules/antd/es/style/motion/slide.js","../../node_modules/antd/es/style/motion/zoom.js","../../node_modules/antd/es/modal/style/index.js","../../node_modules/antd/es/modal/Modal.js","../../node_modules/antd/es/modal/style/confirm.js","../../node_modules/antd/es/modal/ConfirmDialog.js","../../node_modules/antd/es/modal/destroyFns.js","../../node_modules/antd/es/modal/confirm.js","../../node_modules/antd/es/modal/useModal/HookModal.js","../../node_modules/antd/es/modal/useModal/index.js","../../node_modules/antd/es/notification/style/placement.js","../../node_modules/antd/es/notification/interface.js","../../node_modules/antd/es/notification/style/stack.js","../../node_modules/antd/es/notification/style/index.js","../../node_modules/antd/es/notification/style/pure-panel.js","../../node_modules/antd/es/notification/PurePanel.js","../../node_modules/antd/es/notification/util.js","../../node_modules/antd/es/notification/useNotification.js","../../node_modules/antd/es/app/context.js","../../node_modules/antd/es/app/style/index.js","../../node_modules/antd/es/app/index.js","../../node_modules/antd/es/_util/PurePanel.js","../../node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/rc-util/es/hooks/useMergedState.js","../../node_modules/rc-util/es/isMobile.js","../../node_modules/rc-select/es/TransBtn.js","../../node_modules/rc-select/es/hooks/useAllowClear.js","../../node_modules/rc-select/es/hooks/useBaseProps.js","../../node_modules/rc-select/es/hooks/useDelayReset.js","../../node_modules/rc-select/es/hooks/useLock.js","../../node_modules/rc-select/es/hooks/useSelectTriggerControl.js","../../node_modules/rc-select/es/utils/keyUtil.js","../../node_modules/rc-resize-observer/es/utils/observerUtil.js","../../node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js","../../node_modules/rc-resize-observer/es/Collection.js","../../node_modules/rc-resize-observer/es/SingleObserver/index.js","../../node_modules/rc-resize-observer/es/index.js","../../node_modules/rc-overflow/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/rc-overflow/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/rc-overflow/es/Item.js","../../node_modules/rc-overflow/node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/rc-overflow/node_modules/rc-util/es/raf.js","../../node_modules/rc-overflow/es/hooks/channelUpdate.js","../../node_modules/rc-overflow/es/hooks/useEffectState.js","../../node_modules/rc-overflow/es/context.js","../../node_modules/rc-overflow/es/RawItem.js","../../node_modules/rc-overflow/es/Overflow.js","../../node_modules/rc-select/es/Selector/Input.js","../../node_modules/rc-select/es/utils/commonUtil.js","../../node_modules/rc-select/es/hooks/useLayoutEffect.js","../../node_modules/rc-select/es/Selector/MultipleSelector.js","../../node_modules/rc-select/es/Selector/SingleSelector.js","../../node_modules/rc-select/es/Selector/index.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/findDOMNode.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/shadow.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useId.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/isMobile.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@rc-component/trigger/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/@rc-component/trigger/node_modules/react-is/index.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useMemo.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/ref.js","../../node_modules/@rc-component/trigger/es/Popup/Arrow.js","../../node_modules/@rc-component/trigger/es/Popup/Mask.js","../../node_modules/@rc-component/trigger/es/Popup/PopupContent.js","../../node_modules/@rc-component/trigger/es/Popup/index.js","../../node_modules/@rc-component/trigger/es/TriggerWrapper.js","../../node_modules/@rc-component/trigger/es/context.js","../../node_modules/@rc-component/trigger/es/hooks/useAction.js","../../node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/isVisible.js","../../node_modules/@rc-component/trigger/es/util.js","../../node_modules/@rc-component/trigger/es/hooks/useAlign.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/@rc-component/trigger/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/@rc-component/trigger/es/hooks/useWatch.js","../../node_modules/@rc-component/trigger/es/hooks/useWinClick.js","../../node_modules/@rc-component/trigger/es/index.js","../../node_modules/rc-select/es/SelectTrigger.js","../../node_modules/rc-select/es/utils/valueUtil.js","../../node_modules/rc-select/es/SelectContext.js","../../node_modules/rc-select/es/BaseSelect/Polite.js","../../node_modules/rc-select/es/BaseSelect/index.js","../../node_modules/rc-select/es/OptGroup.js","../../node_modules/rc-select/es/Option.js","../../node_modules/rc-util/es/omit.js","../../node_modules/rc-virtual-list/es/Filler.js","../../node_modules/rc-virtual-list/es/ScrollBar.js","../../node_modules/rc-virtual-list/es/Item.js","../../node_modules/rc-virtual-list/es/hooks/useChildren.js","../../node_modules/rc-virtual-list/es/utils/CacheMap.js","../../node_modules/rc-virtual-list/es/hooks/useHeights.js","../../node_modules/rc-virtual-list/es/hooks/useScrollTo.js","../../node_modules/rc-virtual-list/es/utils/algorithmUtil.js","../../node_modules/rc-virtual-list/es/hooks/useDiffItem.js","../../node_modules/rc-virtual-list/es/utils/isFirefox.js","../../node_modules/rc-virtual-list/es/hooks/useOriginScroll.js","../../node_modules/rc-virtual-list/es/hooks/useFrameWheel.js","../../node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js","../../node_modules/rc-virtual-list/es/List.js","../../node_modules/rc-select/es/utils/platformUtil.js","../../node_modules/rc-select/es/OptionList.js","../../node_modules/rc-select/es/hooks/useCache.js","../../node_modules/rc-select/es/hooks/useFilterOptions.js","../../node_modules/rc-select/es/hooks/useId.js","../../node_modules/rc-select/es/utils/legacyUtil.js","../../node_modules/rc-select/es/hooks/useOptions.js","../../node_modules/rc-select/es/hooks/useRefFunc.js","../../node_modules/rc-select/es/Select.js","../../node_modules/antd/es/_util/statusUtils.js","../../node_modules/antd/es/empty/empty.js","../../node_modules/antd/es/empty/simple.js","../../node_modules/antd/es/empty/style/index.js","../../node_modules/antd/es/empty/index.js","../../node_modules/antd/es/config-provider/defaultRenderEmpty.js","../../node_modules/antd/es/form/hooks/useVariants.js","../../node_modules/antd/es/select/mergedBuiltinPlacements.js","../../node_modules/antd/es/select/style/dropdown.js","../../node_modules/antd/es/select/style/multiple.js","../../node_modules/antd/es/select/style/single.js","../../node_modules/antd/es/select/style/token.js","../../node_modules/antd/es/select/style/variants.js","../../node_modules/antd/es/select/style/index.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CheckOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CheckOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/DownOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/DownOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/SearchOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/SearchOutlined.js","../../node_modules/antd/es/select/useIcons.js","../../node_modules/antd/es/select/useShowArrow.js","../../node_modules/antd/es/select/index.js","../../node_modules/antd/es/_util/responsiveObserver.js","../../node_modules/antd/es/_util/hooks/useForceUpdate.js","../../node_modules/antd/es/grid/hooks/useBreakpoint.js","../../node_modules/antd/es/avatar/AvatarContext.js","../../node_modules/antd/es/avatar/style/index.js","../../node_modules/antd/es/avatar/avatar.js","../../node_modules/antd/node_modules/rc-util/es/KeyCode.js","../../node_modules/antd/es/_util/getRenderPropValue.js","../../node_modules/rc-tooltip/es/Popup.js","../../node_modules/rc-tooltip/es/placements.js","../../node_modules/rc-tooltip/es/Tooltip.js","../../node_modules/antd/es/style/roundedArrow.js","../../node_modules/antd/es/style/placementArrow.js","../../node_modules/antd/es/_util/placements.js","../../node_modules/antd/es/tooltip/style/index.js","../../node_modules/antd/es/_util/colors.js","../../node_modules/antd/es/tooltip/util.js","../../node_modules/antd/es/tooltip/PurePanel.js","../../node_modules/antd/es/tooltip/index.js","../../node_modules/antd/es/popover/style/index.js","../../node_modules/antd/es/popover/PurePanel.js","../../node_modules/antd/es/popover/index.js","../../node_modules/antd/es/avatar/group.js","../../node_modules/antd/es/avatar/index.js","../../node_modules/antd/es/badge/style/index.js","../../node_modules/antd/es/badge/style/ribbon.js","../../node_modules/antd/es/badge/Ribbon.js","../../node_modules/antd/es/badge/SingleNumber.js","../../node_modules/antd/es/badge/ScrollNumber.js","../../node_modules/antd/es/badge/index.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/RightOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/RightOutlined.js","../../node_modules/rc-dropdown/es/hooks/useAccessibility.js","../../node_modules/rc-dropdown/es/Overlay.js","../../node_modules/rc-dropdown/es/placements.js","../../node_modules/rc-dropdown/es/Dropdown.js","../../node_modules/rc-menu/es/context/IdContext.js","../../node_modules/rc-menu/es/context/MenuContext.js","../../node_modules/rc-menu/es/context/PathContext.js","../../node_modules/rc-menu/es/context/PrivateContext.js","../../node_modules/rc-util/es/Dom/isVisible.js","../../node_modules/rc-util/es/Dom/focus.js","../../node_modules/rc-menu/es/hooks/useAccessibility.js","../../node_modules/rc-menu/es/utils/timeUtil.js","../../node_modules/rc-menu/es/hooks/useKeyRecords.js","../../node_modules/rc-menu/es/hooks/useMemoCallback.js","../../node_modules/rc-menu/es/hooks/useUUID.js","../../node_modules/rc-menu/es/hooks/useActive.js","../../node_modules/rc-menu/es/hooks/useDirectionStyle.js","../../node_modules/rc-menu/es/Icon.js","../../node_modules/rc-menu/es/utils/warnUtil.js","../../node_modules/rc-menu/es/MenuItem.js","../../node_modules/rc-menu/es/SubMenu/SubMenuList.js","../../node_modules/rc-menu/es/utils/commonUtil.js","../../node_modules/rc-menu/es/placements.js","../../node_modules/rc-menu/es/utils/motionUtil.js","../../node_modules/rc-menu/es/SubMenu/PopupTrigger.js","../../node_modules/rc-menu/es/SubMenu/InlineSubMenuList.js","../../node_modules/rc-menu/es/SubMenu/index.js","../../node_modules/rc-menu/es/Divider.js","../../node_modules/rc-menu/es/MenuItemGroup.js","../../node_modules/rc-menu/es/utils/nodeUtil.js","../../node_modules/rc-menu/es/Menu.js","../../node_modules/rc-menu/es/index.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/BarsOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/BarsOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/LeftOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/LeftOutlined.js","../../node_modules/antd/es/_util/isNumeric.js","../../node_modules/antd/es/layout/context.js","../../node_modules/antd/es/layout/Sider.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/EllipsisOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/EllipsisOutlined.js","../../node_modules/antd/es/menu/MenuDivider.js","../../node_modules/antd/es/menu/MenuContext.js","../../node_modules/antd/es/menu/MenuItem.js","../../node_modules/antd/es/menu/OverrideContext.js","../../node_modules/antd/es/menu/style/horizontal.js","../../node_modules/antd/es/menu/style/rtl.js","../../node_modules/antd/es/menu/style/theme.js","../../node_modules/antd/es/menu/style/vertical.js","../../node_modules/antd/es/menu/style/index.js","../../node_modules/antd/es/menu/SubMenu.js","../../node_modules/antd/es/menu/menu.js","../../node_modules/antd/es/menu/index.js","../../node_modules/antd/es/dropdown/style/status.js","../../node_modules/antd/es/dropdown/style/index.js","../../node_modules/antd/es/dropdown/dropdown.js","../../node_modules/dayjs/dayjs.min.js","../../node_modules/rc-picker/node_modules/rc-util/es/warning.js","../../node_modules/dayjs/plugin/weekday.js","../../node_modules/dayjs/plugin/localeData.js","../../node_modules/rc-picker/node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/rc-picker/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/rc-picker/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/rc-picker/node_modules/rc-util/es/hooks/useState.js","../../node_modules/rc-picker/node_modules/rc-util/es/hooks/useMergedState.js","../../node_modules/rc-picker/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/rc-picker/node_modules/react-is/index.js","../../node_modules/rc-picker/node_modules/rc-util/es/hooks/useMemo.js","../../node_modules/rc-picker/node_modules/rc-util/es/ref.js","../../node_modules/rc-picker/node_modules/rc-util/es/omit.js","../../node_modules/rc-picker/node_modules/rc-util/es/pickAttrs.js","../../node_modules/rc-picker/es/PickerInput/context.js","../../node_modules/rc-picker/es/PickerTrigger/index.js","../../node_modules/rc-picker/es/utils/miscUtil.js","../../node_modules/rc-picker/es/PickerTrigger/util.js","../../node_modules/rc-picker/es/PickerInput/hooks/useCellRender.js","../../node_modules/rc-picker/es/PickerInput/hooks/useFieldsInvalidate.js","../../node_modules/rc-picker/es/hooks/useLocale.js","../../node_modules/rc-picker/es/hooks/useTimeConfig.js","../../node_modules/rc-picker/es/PickerInput/Selector/hooks/useClearIcon.js","../../node_modules/rc-picker/es/utils/dateUtil.js","../../node_modules/rc-picker/es/PickerInput/hooks/useDisabledBoundary.js","../../node_modules/rc-picker/es/PickerInput/hooks/useFieldFormat.js","../../node_modules/rc-picker/es/PickerInput/hooks/useInputReadOnly.js","../../node_modules/rc-picker/es/PickerInput/hooks/useInvalidate.js","../../node_modules/rc-picker/es/PickerInput/hooks/useFilledProps.js","../../node_modules/rc-picker/node_modules/rc-util/es/raf.js","../../node_modules/rc-picker/es/PickerInput/hooks/useDelayState.js","../../node_modules/rc-picker/es/PickerInput/hooks/useOpen.js","../../node_modules/rc-picker/es/PickerInput/hooks/usePickerRef.js","../../node_modules/rc-picker/es/PickerInput/hooks/usePresets.js","../../node_modules/rc-picker/es/PickerInput/hooks/useLockEffect.js","../../node_modules/rc-picker/es/PickerInput/hooks/useRangeActive.js","../../node_modules/rc-picker/es/PickerInput/hooks/useRangeDisabledDate.js","../../node_modules/rc-picker/es/PickerInput/hooks/useRangePickerValue.js","../../node_modules/rc-picker/es/hooks/useSyncState.js","../../node_modules/rc-picker/es/PickerInput/hooks/useRangeValue.js","../../node_modules/rc-picker/es/PickerInput/hooks/useShowNow.js","../../node_modules/rc-picker/node_modules/rc-util/es/Children/toArray.js","../../node_modules/rc-picker/node_modules/rc-util/es/Dom/findDOMNode.js","../../node_modules/rc-picker/node_modules/rc-resize-observer/es/Collection.js","../../node_modules/rc-picker/node_modules/rc-resize-observer/es/utils/observerUtil.js","../../node_modules/rc-picker/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js","../../node_modules/rc-picker/node_modules/rc-resize-observer/es/SingleObserver/index.js","../../node_modules/rc-picker/node_modules/rc-resize-observer/es/index.js","../../node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/util.js","../../node_modules/rc-picker/es/hooks/useTimeInfo.js","../../node_modules/rc-picker/es/PickerInput/Popup/Footer.js","../../node_modules/rc-picker/es/hooks/useToggleDates.js","../../node_modules/rc-picker/es/PickerPanel/context.js","../../node_modules/rc-picker/es/PickerPanel/PanelBody.js","../../node_modules/rc-picker/es/PickerPanel/PanelHeader.js","../../node_modules/rc-picker/es/PickerPanel/DatePanel/index.js","../../node_modules/rc-picker/node_modules/rc-util/es/Dom/isVisible.js","../../node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js","../../node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js","../../node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/index.js","../../node_modules/rc-picker/es/PickerPanel/TimePanel/index.js","../../node_modules/rc-picker/es/PickerPanel/DateTimePanel/index.js","../../node_modules/rc-picker/es/PickerPanel/DecadePanel/index.js","../../node_modules/rc-picker/es/PickerPanel/MonthPanel/index.js","../../node_modules/rc-picker/es/PickerPanel/QuarterPanel/index.js","../../node_modules/rc-picker/es/PickerPanel/WeekPanel/index.js","../../node_modules/rc-picker/es/PickerPanel/YearPanel/index.js","../../node_modules/rc-picker/es/PickerPanel/index.js","../../node_modules/rc-picker/es/PickerInput/Popup/PopupPanel.js","../../node_modules/rc-picker/es/PickerInput/Popup/PresetPanel.js","../../node_modules/rc-picker/es/PickerInput/Popup/index.js","../../node_modules/rc-picker/es/PickerInput/Selector/hooks/useInputProps.js","../../node_modules/rc-picker/es/PickerInput/Selector/hooks/useRootProps.js","../../node_modules/rc-picker/es/PickerInput/Selector/Icon.js","../../node_modules/rc-picker/es/PickerInput/Selector/MaskFormat.js","../../node_modules/rc-picker/es/PickerInput/Selector/util.js","../../node_modules/rc-picker/es/PickerInput/Selector/Input.js","../../node_modules/rc-picker/es/PickerInput/Selector/RangeSelector.js","../../node_modules/rc-picker/es/PickerInput/RangePicker.js","../../node_modules/rc-picker/es/PickerInput/Selector/SingleSelector/MultipleDates.js","../../node_modules/rc-picker/es/PickerInput/Selector/SingleSelector/index.js","../../node_modules/rc-picker/es/PickerInput/SinglePicker.js","../../node_modules/antd/es/radio/context.js","../../node_modules/rc-checkbox/es/index.js","../../node_modules/antd/es/radio/style/index.js","../../node_modules/antd/es/radio/radio.js","../../node_modules/antd/es/radio/group.js","../../node_modules/antd/es/radio/radioButton.js","../../node_modules/antd/es/radio/index.js","../../node_modules/antd/es/input/style/token.js","../../node_modules/antd/es/input/style/variants.js","../../node_modules/antd/es/input/style/index.js","../../node_modules/antd/es/date-picker/style/multiple.js","../../node_modules/antd/es/date-picker/style/panel.js","../../node_modules/antd/es/date-picker/style/token.js","../../node_modules/antd/es/date-picker/style/variants.js","../../node_modules/antd/es/date-picker/style/index.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/PlusOutlined.js","../../node_modules/rc-tabs/es/TabContext.js","../../node_modules/rc-tabs/es/hooks/useIndicator.js","../../node_modules/rc-tabs/es/hooks/useOffsets.js","../../node_modules/rc-tabs/es/hooks/useSyncState.js","../../node_modules/rc-tabs/es/hooks/useTouchMove.js","../../node_modules/rc-tabs/es/hooks/useUpdate.js","../../node_modules/rc-tabs/es/hooks/useVisibleRange.js","../../node_modules/rc-tabs/es/util.js","../../node_modules/rc-tabs/es/TabNavList/AddButton.js","../../node_modules/rc-tabs/es/TabNavList/ExtraContent.js","../../node_modules/rc-tabs/es/TabNavList/OperationNode.js","../../node_modules/rc-tabs/es/TabNavList/TabNode.js","../../node_modules/rc-tabs/es/TabNavList/index.js","../../node_modules/rc-tabs/es/TabPanelList/TabPane.js","../../node_modules/rc-tabs/es/TabNavList/Wrapper.js","../../node_modules/rc-tabs/es/TabPanelList/index.js","../../node_modules/rc-tabs/es/hooks/useAnimateConfig.js","../../node_modules/rc-tabs/es/Tabs.js","../../node_modules/antd/es/tabs/hooks/useAnimateConfig.js","../../node_modules/antd/es/tabs/hooks/useLegacyItems.js","../../node_modules/antd/es/tabs/style/motion.js","../../node_modules/antd/es/tabs/style/index.js","../../node_modules/antd/es/tabs/TabPane.js","../../node_modules/antd/es/tabs/index.js","../../node_modules/antd/es/card/Grid.js","../../node_modules/antd/es/card/style/index.js","../../node_modules/antd/es/card/Card.js","../../node_modules/antd/es/card/Meta.js","../../node_modules/antd/es/card/index.js","../../node_modules/throttle-debounce/esm/index.js","../../node_modules/rc-tree/es/utils/keyUtil.js","../../node_modules/rc-tree/es/utils/treeUtil.js","../../node_modules/rc-tree/es/utils/conductUtil.js","../../node_modules/antd/es/checkbox/style/index.js","../../node_modules/antd/es/checkbox/GroupContext.js","../../node_modules/antd/es/checkbox/Checkbox.js","../../node_modules/antd/es/checkbox/Group.js","../../node_modules/antd/es/checkbox/index.js","../../node_modules/antd/es/grid/RowContext.js","../../node_modules/antd/es/grid/style/index.js","../../node_modules/antd/es/grid/col.js","../../node_modules/antd/es/grid/row.js","../../node_modules/antd/es/divider/style/index.js","../../node_modules/antd/es/divider/index.js","../../node_modules/rc-input/es/utils/commonUtils.js","../../node_modules/rc-input/es/BaseInput.js","../../node_modules/rc-input/es/hooks/useCount.js","../../node_modules/rc-input/es/Input.js","../../node_modules/antd/es/_util/InputAddon.js","../../node_modules/antd/es/input/Group.js","../../node_modules/antd/es/_util/getAllowClear.js","../../node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js","../../node_modules/antd/es/input/utils.js","../../node_modules/antd/es/input/Input.js","../../node_modules/antd/es/input/style/otp.js","../../node_modules/antd/es/input/OTP/OTPInput.js","../../node_modules/antd/es/input/OTP/index.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/EyeInvisibleOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/EyeOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/EyeOutlined.js","../../node_modules/antd/es/input/Password.js","../../node_modules/antd/es/input/Search.js","../../node_modules/rc-textarea/es/calculateNodeHeight.js","../../node_modules/rc-textarea/es/ResizableTextArea.js","../../node_modules/rc-textarea/es/TextArea.js","../../node_modules/antd/es/input/TextArea.js","../../node_modules/antd/es/input/index.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CalendarOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CalendarOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/ClockCircleOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/ClockCircleOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/SwapRightOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/SwapRightOutlined.js","../../node_modules/antd/es/date-picker/util.js","../../node_modules/antd/es/date-picker/PickerButton.js","../../node_modules/antd/es/date-picker/generatePicker/useComponents.js","../../node_modules/antd/es/date-picker/generatePicker/generateRangePicker.js","../../node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js","../../node_modules/antd/es/date-picker/generatePicker/index.js","../../node_modules/antd/es/descriptions/constant.js","../../node_modules/antd/es/descriptions/DescriptionsContext.js","../../node_modules/antd/es/descriptions/hooks/useItems.js","../../node_modules/antd/es/descriptions/hooks/useRow.js","../../node_modules/antd/es/descriptions/Item.js","../../node_modules/antd/es/descriptions/Cell.js","../../node_modules/antd/es/descriptions/Row.js","../../node_modules/antd/es/descriptions/style/index.js","../../node_modules/antd/es/descriptions/index.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/rc-drawer/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/rc-drawer/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/rc-drawer/es/context.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/rc-drawer/node_modules/rc-util/es/KeyCode.js","../../node_modules/rc-drawer/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/rc-drawer/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/rc-drawer/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/rc-drawer/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/rc-drawer/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/rc-drawer/node_modules/rc-util/es/pickAttrs.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/rc-drawer/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/rc-drawer/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/rc-drawer/node_modules/react-is/index.js","../../node_modules/rc-drawer/node_modules/rc-util/es/hooks/useMemo.js","../../node_modules/rc-drawer/node_modules/rc-util/es/ref.js","../../node_modules/rc-drawer/es/DrawerPanel.js","../../node_modules/rc-drawer/node_modules/rc-util/es/warning.js","../../node_modules/rc-drawer/es/util.js","../../node_modules/rc-drawer/es/DrawerPopup.js","../../node_modules/rc-drawer/es/Drawer.js","../../node_modules/antd/es/drawer/DrawerPanel.js","../../node_modules/antd/es/drawer/style/motion.js","../../node_modules/antd/es/drawer/style/index.js","../../node_modules/antd/es/drawer/index.js","../../node_modules/antd/es/_util/gapSize.js","../../node_modules/antd/es/space/context.js","../../node_modules/antd/es/space/Item.js","../../node_modules/antd/es/space/index.js","../../node_modules/antd/es/dropdown/dropdown-button.js","../../node_modules/antd/es/dropdown/index.js","../../node_modules/antd/es/form/hooks/useDebounce.js","../../node_modules/antd/es/form/style/explain.js","../../node_modules/antd/es/form/style/index.js","../../node_modules/antd/es/form/ErrorList.js","../../node_modules/antd/es/form/util.js","../../node_modules/antd/es/form/hooks/useForm.js","../../node_modules/antd/es/form/Form.js","../../node_modules/antd/es/form/hooks/useChildren.js","../../node_modules/antd/es/form/hooks/useFormItemStatus.js","../../node_modules/antd/es/form/hooks/useFrameState.js","../../node_modules/antd/es/form/hooks/useItemRef.js","../../node_modules/antd/es/form/style/fallbackCmp.js","../../node_modules/antd/es/form/FormItemInput.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/QuestionCircleOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js","../../node_modules/antd/es/form/FormItemLabel.js","../../node_modules/antd/es/form/FormItem/StatusProvider.js","../../node_modules/antd/es/form/FormItem/ItemHolder.js","../../node_modules/antd/es/form/FormItem/index.js","../../node_modules/antd/es/form/FormList.js","../../node_modules/antd/es/form/hooks/useFormInstance.js","../../node_modules/antd/es/form/index.js","../../node_modules/rc-util/es/Dom/css.js","../../node_modules/rc-util/es/Dom/addEventListener.js","../../node_modules/rc-image/es/context.js","../../node_modules/rc-image/es/Operations.js","../../node_modules/rc-image/es/hooks/useImageTransform.js","../../node_modules/rc-image/es/getFixScaleEleTransPosition.js","../../node_modules/rc-image/es/previewConfig.js","../../node_modules/rc-image/es/hooks/useMouseEvent.js","../../node_modules/rc-image/es/util.js","../../node_modules/rc-image/es/hooks/useStatus.js","../../node_modules/rc-image/es/hooks/useTouchEvent.js","../../node_modules/rc-image/es/Preview.js","../../node_modules/rc-image/es/common.js","../../node_modules/rc-image/es/hooks/usePreviewItems.js","../../node_modules/rc-image/es/PreviewGroup.js","../../node_modules/rc-image/es/hooks/useRegisterImage.js","../../node_modules/rc-image/es/Image.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/RotateLeftOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/RotateRightOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/RotateRightOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/SwapOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/SwapOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/ZoomInOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/ZoomInOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/ZoomOutOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/ZoomOutOutlined.js","../../node_modules/antd/es/image/style/index.js","../../node_modules/antd/es/image/PreviewGroup.js","../../node_modules/antd/es/image/index.js","../../node_modules/antd/es/layout/hooks/useHasSider.js","../../node_modules/antd/es/layout/style/light.js","../../node_modules/antd/es/layout/style/index.js","../../node_modules/antd/es/layout/layout.js","../../node_modules/antd/es/layout/index.js","../../node_modules/antd/es/_util/extendsObject.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/DoubleLeftOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/DoubleLeftOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/DoubleRightOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/DoubleRightOutlined.js","../../node_modules/rc-pagination/node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/rc-pagination/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/rc-pagination/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/rc-pagination/node_modules/rc-util/es/hooks/useState.js","../../node_modules/rc-pagination/node_modules/rc-util/es/hooks/useMergedState.js","../../node_modules/rc-pagination/node_modules/rc-util/es/KeyCode.js","../../node_modules/rc-pagination/node_modules/rc-util/es/pickAttrs.js","../../node_modules/rc-pagination/es/locale/zh_CN.js","../../node_modules/rc-pagination/es/Options.js","../../node_modules/rc-pagination/es/Pager.js","../../node_modules/rc-pagination/es/Pagination.js","../../node_modules/antd/es/pagination/Select.js","../../node_modules/antd/es/pagination/style/index.js","../../node_modules/antd/es/pagination/style/bordered.js","../../node_modules/antd/es/pagination/Pagination.js","../../node_modules/antd/es/spin/Indicator/Progress.js","../../node_modules/antd/es/spin/Indicator/Looper.js","../../node_modules/antd/es/spin/Indicator/index.js","../../node_modules/antd/es/spin/style/index.js","../../node_modules/antd/es/spin/usePercent.js","../../node_modules/antd/es/spin/index.js","../../node_modules/antd/es/list/context.js","../../node_modules/antd/es/list/Item.js","../../node_modules/antd/es/list/style/index.js","../../node_modules/antd/es/list/index.js","../../node_modules/antd/es/message/index.js","../../node_modules/antd/es/modal/PurePanel.js","../../node_modules/antd/es/modal/index.js","../../node_modules/antd/es/notification/index.js","../../node_modules/rc-progress/es/common.js","../../node_modules/rc-progress/es/hooks/useId.js","../../node_modules/rc-progress/es/Circle/PtgCircle.js","../../node_modules/rc-progress/es/Circle/util.js","../../node_modules/rc-progress/es/Circle/index.js","../../node_modules/antd/es/progress/utils.js","../../node_modules/antd/es/progress/Circle.js","../../node_modules/antd/es/progress/style/index.js","../../node_modules/antd/es/progress/Line.js","../../node_modules/antd/es/progress/Steps.js","../../node_modules/antd/es/progress/progress.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/WarningFilled.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/WarningFilled.js","../../node_modules/antd/es/result/noFound.js","../../node_modules/antd/es/result/serverError.js","../../node_modules/antd/es/result/style/index.js","../../node_modules/antd/es/result/unauthorized.js","../../node_modules/antd/es/result/index.js","../../node_modules/rc-table/es/constant.js","../../node_modules/@rc-component/context/es/context.js","../../node_modules/@rc-component/context/es/Immutable.js","../../node_modules/rc-table/es/context/TableContext.js","../../node_modules/rc-table/node_modules/rc-util/es/hooks/useMemo.js","../../node_modules/rc-table/node_modules/rc-util/es/warning.js","../../node_modules/rc-table/node_modules/rc-util/es/isEqual.js","../../node_modules/rc-table/node_modules/rc-util/es/utils/get.js","../../node_modules/rc-table/es/context/PerfContext.js","../../node_modules/rc-table/es/utils/valueUtil.js","../../node_modules/rc-table/es/Cell/useCellRender.js","../../node_modules/rc-table/es/Cell/useHoverState.js","../../node_modules/rc-table/node_modules/rc-util/es/hooks/useEvent.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/canUseDom.js","../../node_modules/rc-table/node_modules/rc-util/es/hooks/useLayoutEffect.js","../../node_modules/rc-table/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/rc-table/node_modules/react-is/index.js","../../node_modules/rc-table/node_modules/rc-util/es/ref.js","../../node_modules/rc-table/es/Cell/index.js","../../node_modules/rc-table/es/utils/fixUtil.js","../../node_modules/rc-table/es/Footer/SummaryContext.js","../../node_modules/rc-table/es/Footer/Cell.js","../../node_modules/rc-table/es/Footer/Row.js","../../node_modules/rc-table/es/Footer/Summary.js","../../node_modules/rc-table/es/Footer/index.js","../../node_modules/rc-table/es/sugar/Column.js","../../node_modules/rc-table/es/sugar/ColumnGroup.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/isVisible.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/styleChecker.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/contains.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/dynamicCSS.js","../../node_modules/rc-table/node_modules/rc-util/es/getScrollBarSize.js","../../node_modules/rc-table/node_modules/rc-util/es/pickAttrs.js","../../node_modules/rc-table/es/hooks/useFlattenRecords.js","../../node_modules/rc-table/es/hooks/useRowInfo.js","../../node_modules/rc-table/es/Body/ExpandedRow.js","../../node_modules/rc-table/es/Body/BodyRow.js","../../node_modules/rc-table/es/Body/MeasureCell.js","../../node_modules/rc-table/es/Body/MeasureRow.js","../../node_modules/rc-table/es/Body/index.js","../../node_modules/rc-table/es/utils/legacyUtil.js","../../node_modules/rc-table/es/ColGroup.js","../../node_modules/rc-table/es/FixedHolder/index.js","../../node_modules/rc-table/es/Header/HeaderRow.js","../../node_modules/rc-table/es/Header/Header.js","../../node_modules/rc-table/node_modules/rc-util/es/Children/toArray.js","../../node_modules/rc-table/es/hooks/useColumns/useWidthColumns.js","../../node_modules/rc-table/es/hooks/useColumns/index.js","../../node_modules/rc-table/es/utils/expandUtil.js","../../node_modules/rc-table/es/hooks/useExpand.js","../../node_modules/rc-table/es/hooks/useFixedInfo.js","../../node_modules/rc-table/es/hooks/useFrame.js","../../node_modules/rc-table/es/hooks/useHover.js","../../node_modules/rc-table/es/hooks/useSticky.js","../../node_modules/rc-table/es/hooks/useStickyOffsets.js","../../node_modules/rc-table/es/Panel/index.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/addEventListener.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/css.js","../../node_modules/rc-table/node_modules/rc-util/es/raf.js","../../node_modules/rc-table/es/stickyScrollBar.js","../../node_modules/rc-table/es/Table.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/Filler.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/Item.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useChildren.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/utils/algorithmUtil.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useDiffItem.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/utils/isFirefox.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useOriginScroll.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useFrameWheel.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useGetSize.js","../../node_modules/rc-table/node_modules/rc-util/es/Dom/findDOMNode.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/utils/CacheMap.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useHeights.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/hooks/useScrollTo.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/ScrollBar.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/utils/scrollbarUtil.js","../../node_modules/rc-table/node_modules/rc-virtual-list/es/List.js","../../node_modules/rc-table/es/VirtualTable/context.js","../../node_modules/rc-table/es/VirtualTable/VirtualCell.js","../../node_modules/rc-table/es/VirtualTable/BodyLine.js","../../node_modules/rc-table/es/VirtualTable/BodyGrid.js","../../node_modules/rc-table/es/VirtualTable/index.js","../../node_modules/antd/es/table/Column.js","../../node_modules/antd/es/table/ColumnGroup.js","../../node_modules/rc-tree/es/contextTypes.js","../../node_modules/rc-tree/es/Indent.js","../../node_modules/rc-tree/es/TreeNode.js","../../node_modules/rc-tree/es/util.js","../../node_modules/antd/es/_util/hooks/useMultipleSelect.js","../../node_modules/antd/es/table/hooks/useSelection.js","../../node_modules/antd/es/_util/hooks/useProxyImperativeHandle.js","../../node_modules/antd/es/table/ExpandIcon.js","../../node_modules/antd/es/table/hooks/useContainerWidth.js","../../node_modules/antd/es/table/util.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/FilterFilled.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/FilterFilled.js","../../node_modules/antd/es/_util/hooks/useSyncState.js","../../node_modules/rc-tree/es/DropIndicator.js","../../node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js","../../node_modules/rc-tree/es/useUnmount.js","../../node_modules/rc-tree/es/MotionTreeNode.js","../../node_modules/rc-tree/es/utils/diffUtil.js","../../node_modules/rc-tree/es/NodeList.js","../../node_modules/rc-tree/es/Tree.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/FileOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/FileOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/FolderOpenOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/FolderOpenOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/FolderOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/FolderOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/HolderOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/HolderOutlined.js","../../node_modules/antd/es/tree/style/index.js","../../node_modules/antd/es/tree/utils/dropIndicator.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CaretDownFilled.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CaretDownFilled.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/MinusSquareOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/MinusSquareOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/PlusSquareOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/PlusSquareOutlined.js","../../node_modules/antd/es/tree/utils/iconUtil.js","../../node_modules/antd/es/tree/Tree.js","../../node_modules/antd/es/tree/utils/dictUtil.js","../../node_modules/antd/es/tree/DirectoryTree.js","../../node_modules/antd/es/tree/index.js","../../node_modules/antd/es/table/hooks/useFilter/FilterSearch.js","../../node_modules/antd/es/table/hooks/useFilter/FilterWrapper.js","../../node_modules/antd/es/table/hooks/useFilter/FilterDropdown.js","../../node_modules/antd/es/table/hooks/useFilter/index.js","../../node_modules/antd/es/table/hooks/useLazyKVMap.js","../../node_modules/antd/es/table/hooks/usePagination.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CaretDownOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CaretUpOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CaretUpOutlined.js","../../node_modules/antd/es/table/hooks/useSorter.js","../../node_modules/antd/es/table/hooks/useTitleColumns.js","../../node_modules/antd/es/table/RcTable/index.js","../../node_modules/antd/es/table/RcTable/VirtualTable.js","../../node_modules/antd/es/table/style/bordered.js","../../node_modules/antd/es/table/style/ellipsis.js","../../node_modules/antd/es/table/style/empty.js","../../node_modules/antd/es/table/style/expand.js","../../node_modules/antd/es/table/style/filter.js","../../node_modules/antd/es/table/style/fixed.js","../../node_modules/antd/es/table/style/pagination.js","../../node_modules/antd/es/table/style/radius.js","../../node_modules/antd/es/table/style/rtl.js","../../node_modules/antd/es/table/style/selection.js","../../node_modules/antd/es/table/style/size.js","../../node_modules/antd/es/table/style/sorter.js","../../node_modules/antd/es/table/style/sticky.js","../../node_modules/antd/es/table/style/summary.js","../../node_modules/antd/es/table/style/virtual.js","../../node_modules/antd/es/table/style/index.js","../../node_modules/antd/es/table/InternalTable.js","../../node_modules/antd/es/table/Table.js","../../node_modules/antd/es/tag/style/index.js","../../node_modules/antd/es/tag/CheckableTag.js","../../node_modules/antd/es/tag/style/presetCmp.js","../../node_modules/antd/es/_util/capitalize.js","../../node_modules/antd/es/tag/style/statusCmp.js","../../node_modules/antd/es/tag/index.js","../../node_modules/antd/es/theme/getDesignToken.js","../../node_modules/antd/es/theme/themes/compact/genCompactSizeMapToken.js","../../node_modules/antd/es/theme/themes/compact/index.js","../../node_modules/antd/es/theme/themes/dark/colorAlgorithm.js","../../node_modules/antd/es/theme/themes/dark/colors.js","../../node_modules/antd/es/theme/themes/dark/index.js","../../node_modules/antd/es/theme/index.js","../../node_modules/antd/es/_util/transButton.js","../../node_modules/rc-tree-select/es/hooks/useCache.js","../../node_modules/rc-tree-select/es/hooks/useCheckedKeys.js","../../node_modules/rc-tree-select/es/utils/valueUtil.js","../../node_modules/rc-tree-select/es/hooks/useDataEntities.js","../../node_modules/rc-tree-select/es/TreeNode.js","../../node_modules/rc-tree-select/es/utils/legacyUtil.js","../../node_modules/rc-tree-select/es/hooks/useFilterTreeData.js","../../node_modules/rc-tree-select/es/hooks/useRefFunc.js","../../node_modules/rc-tree-select/es/hooks/useTreeData.js","../../node_modules/rc-tree-select/es/LegacyContext.js","../../node_modules/rc-tree-select/es/TreeSelectContext.js","../../node_modules/rc-tree-select/es/OptionList.js","../../node_modules/rc-tree-select/es/utils/strategyUtil.js","../../node_modules/rc-tree-select/es/TreeSelect.js","../../node_modules/antd/es/tree-select/style/index.js","../../node_modules/antd/es/tree-select/index.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/EditOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/EditOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/EnterOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/EnterOutlined.js","../../node_modules/antd/es/typography/style/mixins.js","../../node_modules/antd/es/typography/style/index.js","../../node_modules/antd/es/typography/Editable.js","../../node_modules/toggle-selection/index.js","../../node_modules/copy-to-clipboard/index.js","../../node_modules/antd/es/typography/hooks/useCopyClick.js","../../node_modules/antd/es/typography/hooks/useMergedConfig.js","../../node_modules/antd/es/typography/hooks/useUpdatedEffect.js","../../node_modules/antd/es/typography/hooks/usePrevious.js","../../node_modules/antd/es/typography/Typography.js","../../node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/CopyOutlined.js","../../node_modules/antd/node_modules/@ant-design/icons/es/icons/CopyOutlined.js","../../node_modules/antd/es/typography/Base/util.js","../../node_modules/antd/es/typography/Base/CopyBtn.js","../../node_modules/antd/es/typography/Base/Ellipsis.js","../../node_modules/antd/es/typography/Base/EllipsisTooltip.js","../../node_modules/antd/es/typography/Base/index.js","../../node_modules/antd/es/typography/Link.js","../../node_modules/antd/es/typography/Paragraph.js","../../node_modules/antd/es/typography/Text.js","../../node_modules/antd/es/typography/Title.js","../../node_modules/antd/es/typography/index.js","../../node_modules/@remix-run/router/dist/router.js","../../node_modules/react-router/dist/index.js","../../node_modules/react-router-dom/dist/index.js","../../node_modules/@emotion/stylis/dist/stylis.browser.esm.js","../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/styled-components/dist/styled-components.browser.esm.js","../../src/Routes.ts","../../src/pages/ErrorBoundary/ErrorBoundary.tsx","../../node_modules/@ant-design/icons/es/components/Context.js","../../node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/util.js","../../node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/conversion.js","../../node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js","../../node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/format-input.js","../../node_modules/@ant-design/colors/dist/index.esm.js","../../node_modules/@ant-design/icons/es/utils.js","../../node_modules/@ant-design/icons/es/components/IconBase.js","../../node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js","../../node_modules/@ant-design/icons/es/components/AntdIcon.js","../../node_modules/@ant-design/icons-svg/es/asn/BarChartOutlined.js","../../node_modules/@ant-design/icons/es/icons/BarChartOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/CheckCircleFilled.js","../../node_modules/@ant-design/icons/es/icons/CheckCircleFilled.js","../../node_modules/@ant-design/icons-svg/es/asn/CheckCircleOutlined.js","../../node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/CheckOutlined.js","../../node_modules/@ant-design/icons/es/icons/CheckOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/CloseCircleFilled.js","../../node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js","../../node_modules/@ant-design/icons-svg/es/asn/CloseCircleOutlined.js","../../node_modules/@ant-design/icons/es/icons/CloseCircleOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/CloseOutlined.js","../../node_modules/@ant-design/icons/es/icons/CloseOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/DollarOutlined.js","../../node_modules/@ant-design/icons/es/icons/DollarOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/DownOutlined.js","../../node_modules/@ant-design/icons/es/icons/DownOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/InfoCircleOutlined.js","../../node_modules/@ant-design/icons/es/icons/InfoCircleOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/LeftOutlined.js","../../node_modules/@ant-design/icons/es/icons/LeftOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js","../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/LogoutOutlined.js","../../node_modules/@ant-design/icons/es/icons/LogoutOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/MailOutlined.js","../../node_modules/@ant-design/icons/es/icons/MailOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/MenuOutlined.js","../../node_modules/@ant-design/icons/es/icons/MenuOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/ReloadOutlined.js","../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/RightOutlined.js","../../node_modules/@ant-design/icons/es/icons/RightOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/RocketOutlined.js","../../node_modules/@ant-design/icons/es/icons/RocketOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/SearchOutlined.js","../../node_modules/@ant-design/icons/es/icons/SearchOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/SettingOutlined.js","../../node_modules/@ant-design/icons/es/icons/SettingOutlined.js","../../node_modules/@ant-design/icons-svg/es/asn/UserOutlined.js","../../node_modules/@ant-design/icons/es/icons/UserOutlined.js","../../node_modules/@ant-design/icons/es/components/Icon.js","../../src/theme/colors.ts","../../node_modules/tslib/tslib.es6.mjs","../../node_modules/ts-invariant/lib/invariant.js","../../node_modules/@apollo/client/utilities/globals/maybe.js","../../node_modules/@apollo/client/utilities/globals/global.js","../../node_modules/@apollo/client/utilities/globals/DEV.js","../../node_modules/ts-invariant/process/index.js","../../node_modules/graphql/jsutils/devAssert.mjs","../../node_modules/graphql/jsutils/isObjectLike.mjs","../../node_modules/graphql/jsutils/invariant.mjs","../../node_modules/graphql/language/location.mjs","../../node_modules/graphql/language/printLocation.mjs","../../node_modules/graphql/error/GraphQLError.mjs","../../node_modules/graphql/error/syntaxError.mjs","../../node_modules/graphql/language/ast.mjs","../../node_modules/graphql/language/directiveLocation.mjs","../../node_modules/graphql/language/kinds.mjs","../../node_modules/graphql/language/characterClasses.mjs","../../node_modules/graphql/language/blockString.mjs","../../node_modules/graphql/language/tokenKind.mjs","../../node_modules/graphql/language/lexer.mjs","../../node_modules/graphql/jsutils/inspect.mjs","../../node_modules/graphql/jsutils/instanceOf.mjs","../../node_modules/graphql/language/source.mjs","../../node_modules/graphql/language/parser.mjs","../../node_modules/graphql/language/printString.mjs","../../node_modules/graphql/language/visitor.mjs","../../node_modules/graphql/language/printer.mjs","../../node_modules/graphql/language/predicates.mjs","../../node_modules/@apollo/client/utilities/globals/fix-graphql.js","../../node_modules/@apollo/client/utilities/globals/index.js","../../node_modules/@apollo/client/utilities/graphql/directives.js","../../node_modules/@apollo/client/utilities/graphql/fragments.js","../../node_modules/@apollo/client/utilities/common/objects.js","../../node_modules/@apollo/client/utilities/graphql/storeUtils.js","../../node_modules/@apollo/client/utilities/graphql/getFromAST.js","../../node_modules/@apollo/client/utilities/common/arrays.js","../../node_modules/@apollo/client/utilities/graphql/transform.js","../../node_modules/@apollo/client/utilities/common/mergeDeep.js","../../node_modules/zen-observable-ts/module.js","../../node_modules/symbol-observable/es/ponyfill.js","../../node_modules/symbol-observable/es/index.js","../../node_modules/@apollo/client/utilities/observables/Observable.js","../../node_modules/@apollo/client/utilities/common/cloneDeep.js","../../node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js","../../node_modules/@apollo/client/utilities/observables/iteration.js","../../node_modules/@apollo/client/utilities/observables/asyncMap.js","../../node_modules/@apollo/client/utilities/common/canUse.js","../../node_modules/@apollo/client/utilities/observables/subclassing.js","../../node_modules/@apollo/client/utilities/observables/Concast.js","../../node_modules/@apollo/client/utilities/common/incrementalResult.js","../../node_modules/@apollo/client/utilities/common/errorHandling.js","../../node_modules/@apollo/client/utilities/common/compact.js","../../node_modules/@apollo/client/utilities/common/makeUniqueId.js","../../node_modules/@apollo/client/utilities/common/stringifyForDisplay.js","../../node_modules/@apollo/client/utilities/common/mergeOptions.js","../../node_modules/@apollo/client/link/utils/fromError.js","../../node_modules/@apollo/client/link/utils/throwServerError.js","../../node_modules/@apollo/client/link/utils/validateOperation.js","../../node_modules/@apollo/client/link/utils/createOperation.js","../../node_modules/@apollo/client/link/utils/transformOperation.js","../../node_modules/@apollo/client/link/core/ApolloLink.js","../../node_modules/@apollo/client/link/core/split.js","../../node_modules/@apollo/client/link/core/execute.js","../../node_modules/@apollo/client/version.js","../../node_modules/@apollo/client/utilities/common/responseIterator.js","../../node_modules/@apollo/client/link/http/iterators/async.js","../../node_modules/@apollo/client/link/http/iterators/nodeStream.js","../../node_modules/@apollo/client/link/http/iterators/promise.js","../../node_modules/@apollo/client/link/http/iterators/reader.js","../../node_modules/@apollo/client/link/http/responseIterator.js","../../node_modules/@apollo/client/errors/index.js","../../node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js","../../node_modules/@apollo/client/link/http/serializeFetchParameter.js","../../node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js","../../node_modules/@apollo/client/link/http/checkFetcher.js","../../node_modules/@apollo/client/link/http/createSignalIfSupported.js","../../node_modules/@apollo/client/link/http/selectURI.js","../../node_modules/@apollo/client/link/http/rewriteURIForGET.js","../../node_modules/@apollo/client/link/http/createHttpLink.js","../../node_modules/@apollo/client/link/http/HttpLink.js","../../node_modules/@wry/equality/lib/index.js","../../node_modules/optimism/node_modules/@wry/trie/lib/trie.esm.js","../../node_modules/@wry/context/lib/slot.js","../../node_modules/optimism/lib/bundle.esm.js","../../node_modules/@apollo/client/cache/core/cache.js","../../node_modules/@apollo/client/cache/core/types/common.js","../../node_modules/@wry/trie/lib/index.js","../../node_modules/@apollo/client/cache/inmemory/helpers.js","../../node_modules/@apollo/client/cache/inmemory/entityStore.js","../../node_modules/@apollo/client/cache/inmemory/object-canon.js","../../node_modules/@apollo/client/cache/inmemory/readFromStore.js","../../node_modules/@apollo/client/cache/inmemory/reactiveVars.js","../../node_modules/@apollo/client/cache/inmemory/key-extractor.js","../../node_modules/@apollo/client/cache/inmemory/policies.js","../../node_modules/@apollo/client/cache/inmemory/writeToStore.js","../../node_modules/@apollo/client/cache/inmemory/inMemoryCache.js","../../node_modules/@apollo/client/core/networkStatus.js","../../node_modules/@apollo/client/core/ObservableQuery.js","../../node_modules/@apollo/client/core/LocalState.js","../../node_modules/@apollo/client/core/QueryInfo.js","../../node_modules/@apollo/client/core/QueryManager.js","../../node_modules/@apollo/client/core/ApolloClient.js","../../node_modules/graphql-tag/lib/index.js","../../node_modules/@apollo/client/react/context/ApolloContext.js","../../node_modules/@apollo/client/react/context/ApolloProvider.js","../../node_modules/@apollo/client/react/hooks/useApolloClient.js","../../node_modules/@apollo/client/react/hooks/useSyncExternalStore.js","../../node_modules/@apollo/client/react/parser/index.js","../../node_modules/@apollo/client/react/hooks/useQuery.js","../../node_modules/@apollo/client/react/hooks/useLazyQuery.js","../../node_modules/@apollo/client/react/hooks/useMutation.js","../../node_modules/@apollo/client/react/hooks/useSubscription.js","../../node_modules/@apollo/client/react/hooks/useReactiveVar.js","../../src/__generated__/graphql.tsx","../../src/contexts/jwtContext.ts","../../node_modules/graphql-ws/lib/utils.mjs","../../node_modules/graphql-ws/lib/common.mjs","../../node_modules/graphql-ws/lib/client.mjs","../../node_modules/@apollo/client/link/context/index.js","../../node_modules/@apollo/client/link/subscriptions/index.js","../../node_modules/jwt-decode/build/jwt-decode.esm.js","../../src/common/types/localStorage.ts","../../src/services/storage.ts","../../src/services/auth.ts","../../src/graphql/client.ts","../../src/components/HeaderActions/Profile/Profile.tsx","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js","../../node_modules/use-sync-external-store/shim/with-selector.js","../../node_modules/xstate/es/_virtual/_tslib.js","../../node_modules/xstate/es/types.js","../../node_modules/xstate/es/actionTypes.js","../../node_modules/xstate/es/constants.js","../../node_modules/xstate/es/utils.js","../../node_modules/xstate/es/actions.js","../../node_modules/xstate/es/serviceScope.js","../../node_modules/xstate/es/Actor.js","../../node_modules/xstate/es/stateUtils.js","../../node_modules/xstate/es/State.js","../../node_modules/xstate/es/scheduler.js","../../node_modules/xstate/es/registry.js","../../node_modules/xstate/es/devTools.js","../../node_modules/xstate/es/behaviors.js","../../node_modules/xstate/es/interpreter.js","../../node_modules/xstate/es/invokeUtils.js","../../node_modules/xstate/es/StateNode.js","../../node_modules/xstate/es/Machine.js","../../node_modules/xstate/es/mapState.js","../../node_modules/xstate/es/match.js","../../node_modules/xstate/es/schema.js","../../node_modules/xstate/es/index.js","../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js","../../node_modules/@xstate/react/es/useConstant.js","../../node_modules/@xstate/react/es/useInterpret.js","../../node_modules/@xstate/react/es/utils.js","../../node_modules/@xstate/react/es/useActor.js","../../node_modules/@xstate/react/es/useSelector.js","../../src/machines/dashboardMachine/dashboardMachine.tsx","../../src/contexts/GlobalStateContext.tsx","../../src/components/HeaderActions/Reload/Reload.tsx","../../src/assets/fb.png","../../src/components/HeaderActions/AdPlatform/AdPlatform.tsx","../../src/assets/dashboard_assets/browser-window.tsx","../../src/assets/dashboard_assets/ph_folder.tsx","../../src/assets/dashboard_assets/promotion.tsx","../../src/components/StyledComponents/BackButton.tsx","../../src/components/StyledComponents/Button.tsx","../../src/theme/breakpoints.ts","../../src/components/StyledComponents/Card.tsx","../../src/components/StyledComponents/FormItem.tsx","../../src/components/StyledComponents/Input.tsx","../../src/components/StyledComponents/OnboardingBackground.tsx","../../src/components/StyledComponents/OnboardingContainer.tsx","../../src/components/StyledComponents/Spin.tsx","../../src/components/StyledComponents/FilterButton.tsx","../../src/components/StyledComponents/SearchInput.tsx","../../src/components/StyledComponents/CopyableText.tsx","../../src/components/StyledComponents/DashboardTabs.tsx","../../src/components/AttributionTab/SelectedPill.tsx","../../src/components/AttributionTab/AttributionTabLabel.tsx","../../src/utils/pluralize.ts","../../src/utils/useMultiSort.ts","../../src/common/utils/formatter.ts","../../src/utils/dashboard-util.ts","../../src/components/AttributionTable/TableSummary.tsx","../../src/components/AttributionTable/AttributionTable.tsx","../../src/components/AttributionTables/columns.tsx","../../src/components/AttributionTables/CampaignsTable.tsx","../../src/components/AttributionTables/AdsetsTable.tsx","../../src/components/AttributionTables/AdsTable.tsx","../../src/components/SearchBar/SearchSelect.tsx","../../src/components/SearchBar/SearchBar.tsx","../../src/components/AttributionCard/AttributionCard.tsx","../../src/assets/logo.svg","../../src/assets/shopify.svg","../../src/assets/paw.png","../../src/components/AppSider/AppSider.tsx","../../src/components/ResponsiveSiderLayout/MobileAppHeader.tsx","../../src/components/AppHeader/AppHeader.tsx","../../src/components/ResponsiveSiderLayout/ResponsiveSiderLayout.tsx","../../src/assets/dashboard_assets/connect-accont.svg","../../node_modules/dayjs/plugin/duration.js","../../node_modules/dayjs/plugin/utc.js","../../node_modules/dayjs/plugin/timezone.js","../../node_modules/dayjs/locale/fr.js","../../src/services/dayjs.ts","../../node_modules/rc-util/lib/warning.js","../../src/components/DashboardRangePicker/generateConfig.ts","../../src/components/DashboardRangePicker/DatePicker.tsx","../../src/hooks/useDayjsHook.tsx","../../src/components/DashboardRangePicker/DashboardRangePicker.tsx","../../node_modules/@xstate/react/lib/useConstant.js","../../node_modules/@xstate/react/lib/utils.js","../../node_modules/@xstate/react/lib/useActor.js","../../node_modules/@xstate/react/lib/useSelector.js","../../src/components/MetricsContainer/MetricsContainer.tsx","../../src/assets/quickstart_assets/utm_warning.jpg","../../src/pages/QuickStart/Subscription/UTMWarningModal.tsx","../../src/components/ShopifyAuth/ShopifyAuth.tsx","../../src/pages/Dashboard/Dashboard.tsx","../../node_modules/country-list/country-list.js","../../src/components/StyledComponents/Select.tsx","../../src/utils/sortCountries.ts","../../src/components/CreateOrganizationForm/CreateOrganizationForm.tsx","../../src/assets/snow-fox.jpg","../../src/pages/CreateOrganization/CreateOrganization.tsx","../../src/assets/fb-white.svg","../../src/assets/shopify-white.svg","../../src/assets/discord-white.svg","../../src/pages/QuickStart/QuickStart.tsx","../../src/components/CreateStoreForm/CreateStoreForm.tsx","../../src/assets/snow-fox-2.jpg","../../src/pages/CreateStore/CreateStore.tsx","../../node_modules/react-international-phone/build/index.mjs","../../src/components/StyledComponents/PhoneInput.tsx","../../node_modules/@vvo/tzdb/lib/formatTimeZone.js","../../node_modules/@vvo/tzdb/lib/utils/timeZone.js","../../node_modules/@vvo/tzdb/lib/getTimeZones.js","../../node_modules/fuse.js/dist/fuse.mjs","../../src/components/TimezoneSelect/filterTimezones.ts","../../src/components/TimezoneSelect/TimezoneSelect.tsx","../../src/components/ProfileSettingsForm/ProfileSettingsForm.tsx","../../src/pages/ProfileSettings/ProfileSettings.tsx","../../src/utils/facebookPixel.ts","../../src/pages/QuickStart/Subscription/SubscriptionCard.tsx","../../src/pages/QuickStart/Subscription/SubscriptionCarosel.tsx","../../src/pages/QuickStart/Subscription/SubscriptionPage.tsx","../../src/pages/SubscriptionSettings/SubscriptionSettings.tsx","../../src/assets/support_logo.svg","../../src/components/SupportSettingsForm/SupportSettingsForm.tsx","../../src/pages/SupportSettings/SupportSettings.tsx","../../node_modules/load-script/index.js","../../node_modules/deepmerge/dist/cjs.js","../../node_modules/react-player/lib/utils.js","../../node_modules/react-player/lib/patterns.js","../../node_modules/react-player/lib/players/YouTube.js","../../node_modules/react-player/lib/players/SoundCloud.js","../../node_modules/react-player/lib/players/Vimeo.js","../../node_modules/react-player/lib/players/Facebook.js","../../node_modules/react-player/lib/players/Streamable.js","../../node_modules/react-player/lib/players/Wistia.js","../../node_modules/react-player/lib/players/Twitch.js","../../node_modules/react-player/lib/players/DailyMotion.js","../../node_modules/react-player/lib/players/Mixcloud.js","../../node_modules/react-player/lib/players/Vidyard.js","../../node_modules/react-player/lib/players/Kaltura.js","../../node_modules/react-player/lib/players/FilePlayer.js","../../node_modules/react-player/lib/players/index.js","../../node_modules/memoize-one/dist/memoize-one.esm.js","../../node_modules/react-fast-compare/index.js","../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/prop-types/index.js","../../node_modules/react-player/lib/props.js","../../node_modules/react-player/lib/Player.js","../../node_modules/react-player/lib/Preview.js","../../node_modules/react-player/lib/ReactPlayer.js","../../node_modules/react-player/lib/index.js","../../src/components/SetupStep/SetupStep.tsx","../../src/assets/quickstart_assets/utm_field.png","../../src/pages/SetupUTM/SetupUTM.tsx","../../src/pages/QuickStart/SetupOurPixel/SetupOurPixel.tsx","../../src/pages/SetupTracking/SetupTracking.tsx","../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/toPrimitive.js","../../node_modules/@babel/runtime/helpers/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/objectSpread2.js","../../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../../node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../../node_modules/@ant-design/icons/lib/components/Context.js","../../node_modules/rc-util/lib/Dom/canUseDom.js","../../node_modules/rc-util/lib/Dom/contains.js","../../node_modules/rc-util/lib/Dom/dynamicCSS.js","../../node_modules/@ant-design/icons/lib/utils.js","../../node_modules/@ant-design/icons/lib/components/Icon.js","../../src/assets/icons.tsx","../../src/components/ProgressContainer/ProgressCard/ProgressCard.tsx","../../src/components/ProgressContainer/ProgressContainer.tsx","../../src/pages/Subscription/SubscriptionPage.tsx","../../src/components/SubscriptionGuard/SubscriptionGuard.tsx","../../src/routes/privateRoutes.tsx","../../src/components/LoginForm/LoginForm.tsx","../../src/assets/snow-fox-4.jpg","../../src/pages/Login/Login.tsx","../../src/components/RegisterForm/RegisterForm.tsx","../../src/assets/sky-fox.jpg","../../src/pages/Register/Register.tsx","../../src/hooks/useLocalStorage.ts","../../src/routes/publicRoutes.tsx","../../src/assets/arrow_left.svg","../../src/components/SendCodeForm/SendCodeForm.tsx","../../src/assets/portal-fox.jpg","../../src/layouts/PasswordResetLayout.tsx","../../src/pages/SendCode/SendCode.tsx","../../node_modules/react-otp-input/lib/index.esm.js","../../src/components/VerifyCodeForm/VerifyCodeForm.tsx","../../src/pages/VerifyCode/VerifyCode.tsx","../../src/components/ResetPasswordForm/ResetPasswordForm.tsx","../../src/pages/ResetPassword/ResetPassword.tsx","../../src/pages/Legal/TermsOfService.tsx","../../src/pages/Legal/PrivacyPolicy.tsx","../../src/pages/Legal/RefundPolicy.tsx","../../src/pages/Legal/Legal.tsx","../../src/components/VerifyAccountForm/VerifyAccountForm.tsx","../../src/pages/VerifyAccount/VerifyAccount.tsx","../../src/routes/sharedRoutes.tsx","../../src/Router.tsx","../../src/providers/jwtProvider.tsx","../../src/common/utils/calcBreakpoints.ts","../../src/main.tsx"],"sourcesContent":["/**\n * @license React\n * react.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 l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.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 Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3 1 && arguments[1] !== undefined ? arguments[1] : {};\n var ret = [];\n React.Children.forEach(children, function (child) {\n if ((child === undefined || child === null) && !option.keepEmpty) {\n return;\n }\n if (Array.isArray(child)) {\n ret = ret.concat(toArray(child));\n } else if (isFragment(child) && child.props) {\n ret = ret.concat(toArray(child.props.children, option));\n } else {\n ret.push(child);\n }\n });\n return ret;\n}","/* eslint-disable no-console */\nvar warned = {};\nvar preWarningFns = [];\n\n/**\n * Pre warning enable you to parse content before console.error.\n * Modify to null will prevent warning.\n */\nexport var preMessage = function preMessage(fn) {\n preWarningFns.push(fn);\n};\n\n/**\n * Warning if condition not match.\n * @param valid Condition\n * @param message Warning message\n * @example\n * ```js\n * warning(false, 'some error'); // print some error\n * warning(true, 'some error'); // print nothing\n * warning(1 === 2, 'some error'); // print some error\n * ```\n */\nexport function warning(valid, message) {\n if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {\n var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {\n return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');\n }, message);\n if (finalMessage) {\n console.error(\"Warning: \".concat(finalMessage));\n }\n }\n}\n\n/** @see Similar to {@link warning} */\nexport function note(valid, message) {\n if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {\n var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {\n return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');\n }, message);\n if (finalMessage) {\n console.warn(\"Note: \".concat(finalMessage));\n }\n }\n}\nexport function resetWarned() {\n warned = {};\n}\nexport function call(method, valid, message) {\n if (!valid && !warned[message]) {\n method(false, message);\n warned[message] = true;\n }\n}\n\n/** @see Same as {@link warning}, but only warn once for the same message */\nexport function warningOnce(valid, message) {\n call(warning, valid, message);\n}\n\n/** @see Same as {@link warning}, but only warn once for the same message */\nexport function noteOnce(valid, message) {\n call(note, valid, message);\n}\nwarningOnce.preMessage = preMessage;\nwarningOnce.resetWarned = resetWarned;\nwarningOnce.noteOnce = noteOnce;\nexport default warningOnce;","export default function _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}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n return keys;\n}\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}","export default function _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}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nexport function isDOM(node) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Element\n // Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement\n return node instanceof HTMLElement || node instanceof SVGElement;\n}\n\n/**\n * Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.\n */\nexport function getDOM(node) {\n if (node && _typeof(node) === 'object' && isDOM(node.nativeElement)) {\n return node.nativeElement;\n }\n if (isDOM(node)) {\n return node;\n }\n return null;\n}\n\n/**\n * Return if a node is a DOM node. Else will return by `findDOMNode`\n */\nexport default function findDOMNode(node) {\n var domNode = getDOM(node);\n if (domNode) {\n return domNode;\n }\n if (node instanceof React.Component) {\n var _ReactDOM$findDOMNode;\n return (_ReactDOM$findDOMNode = ReactDOM.findDOMNode) === null || _ReactDOM$findDOMNode === void 0 ? void 0 : _ReactDOM$findDOMNode.call(ReactDOM, node);\n }\n return null;\n}","import * as React from 'react';\nexport default function useMemo(getValue, condition, shouldUpdate) {\n var cacheRef = React.useRef({});\n if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {\n cacheRef.current.value = getValue();\n cacheRef.current.condition = condition;\n }\n return cacheRef.current.value;\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport { isValidElement, version } from 'react';\nimport { ForwardRef, isFragment, isMemo } from 'react-is';\nimport useMemo from \"./hooks/useMemo\";\nexport var fillRef = function fillRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n ref.current = node;\n }\n};\n\n/**\n * Merge refs into one ref function to support ref passing.\n */\nexport var composeRef = function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n var refList = refs.filter(Boolean);\n if (refList.length <= 1) {\n return refList[0];\n }\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n};\nexport var useComposeRef = function useComposeRef() {\n for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n refs[_key2] = arguments[_key2];\n }\n return useMemo(function () {\n return composeRef.apply(void 0, refs);\n }, refs, function (prev, next) {\n return prev.length !== next.length || prev.every(function (ref, i) {\n return ref !== next[i];\n });\n });\n};\nexport var supportRef = function supportRef(nodeOrComponent) {\n var _type$prototype, _nodeOrComponent$prot;\n var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;\n\n // Function component node\n if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== ForwardRef) {\n return false;\n }\n\n // Class component\n if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== ForwardRef) {\n return false;\n }\n return true;\n};\nfunction isReactElement(node) {\n return /*#__PURE__*/isValidElement(node) && !isFragment(node);\n}\nexport var supportNodeRef = function supportNodeRef(node) {\n return isReactElement(node) && supportRef(node);\n};\n\n/**\n * In React 19. `ref` is not a property from node.\n * But a property from `props.ref`.\n * To check if `props.ref` exist or fallback to `ref`.\n */\nexport var getNodeRef = Number(version.split('.')[0]) >= 19 ?\n// >= React 19\nfunction (node) {\n if (isReactElement(node)) {\n return node.props.ref;\n }\n return null;\n} :\n// < React 19\nfunction (node) {\n if (isReactElement(node)) {\n return node.ref;\n }\n return null;\n};","import * as React from 'react';\nexport var CollectionContext = /*#__PURE__*/React.createContext(null);\n/**\n * Collect all the resize event from children ResizeObserver\n */\nexport function Collection(_ref) {\n var children = _ref.children,\n onBatchResize = _ref.onBatchResize;\n var resizeIdRef = React.useRef(0);\n var resizeInfosRef = React.useRef([]);\n var onCollectionResize = React.useContext(CollectionContext);\n var onResize = React.useCallback(function (size, element, data) {\n resizeIdRef.current += 1;\n var currentId = resizeIdRef.current;\n resizeInfosRef.current.push({\n size: size,\n element: element,\n data: data\n });\n Promise.resolve().then(function () {\n if (currentId === resizeIdRef.current) {\n onBatchResize === null || onBatchResize === void 0 || onBatchResize(resizeInfosRef.current);\n resizeInfosRef.current = [];\n }\n });\n\n // Continue bubbling if parent exist\n onCollectionResize === null || onCollectionResize === void 0 || onCollectionResize(size, element, data);\n }, [onBatchResize, onCollectionResize]);\n return /*#__PURE__*/React.createElement(CollectionContext.Provider, {\n value: onResize\n }, children);\n}","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","import ResizeObserver from 'resize-observer-polyfill';\n// =============================== Const ===============================\nvar elementListeners = new Map();\nfunction onResize(entities) {\n entities.forEach(function (entity) {\n var _elementListeners$get;\n var target = entity.target;\n (_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 || _elementListeners$get.forEach(function (listener) {\n return listener(target);\n });\n });\n}\n\n// Note: ResizeObserver polyfill not support option to measure border-box resize\nvar resizeObserver = new ResizeObserver(onResize);\n\n// Dev env only\nexport var _el = process.env.NODE_ENV !== 'production' ? elementListeners : null; // eslint-disable-line\nexport var _rs = process.env.NODE_ENV !== 'production' ? onResize : null; // eslint-disable-line\n\n// ============================== Observe ==============================\nexport function observe(element, callback) {\n if (!elementListeners.has(element)) {\n elementListeners.set(element, new Set());\n resizeObserver.observe(element);\n }\n elementListeners.get(element).add(callback);\n}\nexport function unobserve(element, callback) {\n if (elementListeners.has(element)) {\n elementListeners.get(element).delete(callback);\n if (!elementListeners.get(element).size) {\n resizeObserver.unobserve(element);\n elementListeners.delete(element);\n }\n }\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nexport default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n };\n}","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\n/**\n * Fallback to findDOMNode if origin ref do not provide any dom element\n */\nvar DomWrapper = /*#__PURE__*/function (_React$Component) {\n _inherits(DomWrapper, _React$Component);\n var _super = _createSuper(DomWrapper);\n function DomWrapper() {\n _classCallCheck(this, DomWrapper);\n return _super.apply(this, arguments);\n }\n _createClass(DomWrapper, [{\n key: \"render\",\n value: function render() {\n return this.props.children;\n }\n }]);\n return DomWrapper;\n}(React.Component);\nexport { DomWrapper as default };","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport findDOMNode from \"rc-util/es/Dom/findDOMNode\";\nimport { supportRef, useComposeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { CollectionContext } from \"../Collection\";\nimport { observe, unobserve } from \"../utils/observerUtil\";\nimport DomWrapper from \"./DomWrapper\";\nfunction SingleObserver(props, ref) {\n var children = props.children,\n disabled = props.disabled;\n var elementRef = React.useRef(null);\n var wrapperRef = React.useRef(null);\n var onCollectionResize = React.useContext(CollectionContext);\n\n // =========================== Children ===========================\n var isRenderProps = typeof children === 'function';\n var mergedChildren = isRenderProps ? children(elementRef) : children;\n\n // ============================= Size =============================\n var sizeRef = React.useRef({\n width: -1,\n height: -1,\n offsetWidth: -1,\n offsetHeight: -1\n });\n\n // ============================= Ref ==============================\n var canRef = !isRenderProps && /*#__PURE__*/React.isValidElement(mergedChildren) && supportRef(mergedChildren);\n var originRef = canRef ? mergedChildren.ref : null;\n var mergedRef = useComposeRef(originRef, elementRef);\n var getDom = function getDom() {\n var _elementRef$current;\n return findDOMNode(elementRef.current) || (\n // Support `nativeElement` format\n elementRef.current && _typeof(elementRef.current) === 'object' ? findDOMNode((_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.nativeElement) : null) || findDOMNode(wrapperRef.current);\n };\n React.useImperativeHandle(ref, function () {\n return getDom();\n });\n\n // =========================== Observe ============================\n var propsRef = React.useRef(props);\n propsRef.current = props;\n\n // Handler\n var onInternalResize = React.useCallback(function (target) {\n var _propsRef$current = propsRef.current,\n onResize = _propsRef$current.onResize,\n data = _propsRef$current.data;\n var _target$getBoundingCl = target.getBoundingClientRect(),\n width = _target$getBoundingCl.width,\n height = _target$getBoundingCl.height;\n var offsetWidth = target.offsetWidth,\n offsetHeight = target.offsetHeight;\n\n /**\n * Resize observer trigger when content size changed.\n * In most case we just care about element size,\n * let's use `boundary` instead of `contentRect` here to avoid shaking.\n */\n var fixedWidth = Math.floor(width);\n var fixedHeight = Math.floor(height);\n if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {\n var size = {\n width: fixedWidth,\n height: fixedHeight,\n offsetWidth: offsetWidth,\n offsetHeight: offsetHeight\n };\n sizeRef.current = size;\n\n // IE is strange, right?\n var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;\n var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;\n var sizeInfo = _objectSpread(_objectSpread({}, size), {}, {\n offsetWidth: mergedOffsetWidth,\n offsetHeight: mergedOffsetHeight\n });\n\n // Let collection know what happened\n onCollectionResize === null || onCollectionResize === void 0 || onCollectionResize(sizeInfo, target, data);\n if (onResize) {\n // defer the callback but not defer to next frame\n Promise.resolve().then(function () {\n onResize(sizeInfo, target);\n });\n }\n }\n }, []);\n\n // Dynamic observe\n React.useEffect(function () {\n var currentElement = getDom();\n if (currentElement && !disabled) {\n observe(currentElement, onInternalResize);\n }\n return function () {\n return unobserve(currentElement, onInternalResize);\n };\n }, [elementRef.current, disabled]);\n\n // ============================ Render ============================\n return /*#__PURE__*/React.createElement(DomWrapper, {\n ref: wrapperRef\n }, canRef ? /*#__PURE__*/React.cloneElement(mergedChildren, {\n ref: mergedRef\n }) : mergedChildren);\n}\nvar RefSingleObserver = /*#__PURE__*/React.forwardRef(SingleObserver);\nif (process.env.NODE_ENV !== 'production') {\n RefSingleObserver.displayName = 'SingleObserver';\n}\nexport default RefSingleObserver;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { warning } from \"rc-util/es/warning\";\nimport SingleObserver from \"./SingleObserver\";\nimport { Collection } from \"./Collection\";\nvar INTERNAL_PREFIX_KEY = 'rc-observer-key';\nimport { _rs } from \"./utils/observerUtil\";\nexport { /** @private Test only for mock trigger resize event */\n_rs };\nfunction ResizeObserver(props, ref) {\n var children = props.children;\n var childNodes = typeof children === 'function' ? [children] : toArray(children);\n if (process.env.NODE_ENV !== 'production') {\n if (childNodes.length > 1) {\n warning(false, 'Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.');\n } else if (childNodes.length === 0) {\n warning(false, '`children` of ResizeObserver is empty. Nothing is in observe.');\n }\n }\n return childNodes.map(function (child, index) {\n var key = (child === null || child === void 0 ? void 0 : child.key) || \"\".concat(INTERNAL_PREFIX_KEY, \"-\").concat(index);\n return /*#__PURE__*/React.createElement(SingleObserver, _extends({}, props, {\n key: key,\n ref: index === 0 ? ref : undefined\n }), child);\n });\n}\nvar RefResizeObserver = /*#__PURE__*/React.forwardRef(ResizeObserver);\nif (process.env.NODE_ENV !== 'production') {\n RefResizeObserver.displayName = 'ResizeObserver';\n}\nRefResizeObserver.Collection = Collection;\nexport default RefResizeObserver;","export default function omit(obj, fields) {\n var clone = Object.assign({}, obj);\n if (Array.isArray(fields)) {\n fields.forEach(function (key) {\n delete clone[key];\n });\n }\n return clone;\n}","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","var raf = function raf(callback) {\n return +setTimeout(callback, 16);\n};\nvar caf = function caf(num) {\n return clearTimeout(num);\n};\nif (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {\n raf = function raf(callback) {\n return window.requestAnimationFrame(callback);\n };\n caf = function caf(handle) {\n return window.cancelAnimationFrame(handle);\n };\n}\nvar rafUUID = 0;\nvar rafIds = new Map();\nfunction cleanup(id) {\n rafIds.delete(id);\n}\nvar wrapperRaf = function wrapperRaf(callback) {\n var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n rafUUID += 1;\n var id = rafUUID;\n function callRef(leftTimes) {\n if (leftTimes === 0) {\n // Clean up\n cleanup(id);\n\n // Trigger\n callback();\n } else {\n // Next raf\n var realId = raf(function () {\n callRef(leftTimes - 1);\n });\n\n // Bind real raf id\n rafIds.set(id, realId);\n }\n }\n callRef(times);\n return id;\n};\nwrapperRaf.cancel = function (id) {\n var realId = rafIds.get(id);\n cleanup(id);\n return caf(realId);\n};\nif (process.env.NODE_ENV !== 'production') {\n wrapperRaf.ids = function () {\n return rafIds;\n };\n}\nexport default wrapperRaf;","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _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}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n return keys;\n}\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\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 default murmur2;\n","export default function canUseDom() {\n return !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n}","export default function contains(root, n) {\n if (!root) {\n return false;\n }\n\n // Use native if support\n if (root.contains) {\n return root.contains(n);\n }\n\n // `document.contains` not support with IE11\n var node = n;\n while (node) {\n if (node === root) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport canUseDom from \"./canUseDom\";\nimport contains from \"./contains\";\nvar APPEND_ORDER = 'data-rc-order';\nvar APPEND_PRIORITY = 'data-rc-priority';\nvar MARK_KEY = \"rc-util-key\";\nvar containerCache = new Map();\nfunction getMark() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n mark = _ref.mark;\n if (mark) {\n return mark.startsWith('data-') ? mark : \"data-\".concat(mark);\n }\n return MARK_KEY;\n}\nfunction getContainer(option) {\n if (option.attachTo) {\n return option.attachTo;\n }\n var head = document.querySelector('head');\n return head || document.body;\n}\nfunction getOrder(prepend) {\n if (prepend === 'queue') {\n return 'prependQueue';\n }\n return prepend ? 'prepend' : 'append';\n}\n\n/**\n * Find style which inject by rc-util\n */\nfunction findStyles(container) {\n return Array.from((containerCache.get(container) || container).children).filter(function (node) {\n return node.tagName === 'STYLE';\n });\n}\nexport function injectCSS(css) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!canUseDom()) {\n return null;\n }\n var csp = option.csp,\n prepend = option.prepend,\n _option$priority = option.priority,\n priority = _option$priority === void 0 ? 0 : _option$priority;\n var mergedOrder = getOrder(prepend);\n var isPrependQueue = mergedOrder === 'prependQueue';\n var styleNode = document.createElement('style');\n styleNode.setAttribute(APPEND_ORDER, mergedOrder);\n if (isPrependQueue && priority) {\n styleNode.setAttribute(APPEND_PRIORITY, \"\".concat(priority));\n }\n if (csp !== null && csp !== void 0 && csp.nonce) {\n styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;\n }\n styleNode.innerHTML = css;\n var container = getContainer(option);\n var firstChild = container.firstChild;\n if (prepend) {\n // If is queue `prepend`, it will prepend first style and then append rest style\n if (isPrependQueue) {\n var existStyle = (option.styles || findStyles(container)).filter(function (node) {\n // Ignore style which not injected by rc-util with prepend\n if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {\n return false;\n }\n\n // Ignore style which priority less then new style\n var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);\n return priority >= nodePriority;\n });\n if (existStyle.length) {\n container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);\n return styleNode;\n }\n }\n\n // Use `insertBefore` as `prepend`\n container.insertBefore(styleNode, firstChild);\n } else {\n container.appendChild(styleNode);\n }\n return styleNode;\n}\nfunction findExistNode(key) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var container = getContainer(option);\n return (option.styles || findStyles(container)).find(function (node) {\n return node.getAttribute(getMark(option)) === key;\n });\n}\nexport function removeCSS(key) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var existNode = findExistNode(key, option);\n if (existNode) {\n var container = getContainer(option);\n container.removeChild(existNode);\n }\n}\n\n/**\n * qiankun will inject `appendChild` to insert into other\n */\nfunction syncRealContainer(container, option) {\n var cachedRealContainer = containerCache.get(container);\n\n // Find real container when not cached or cached container removed\n if (!cachedRealContainer || !contains(document, cachedRealContainer)) {\n var placeholderStyle = injectCSS('', option);\n var parentNode = placeholderStyle.parentNode;\n containerCache.set(container, parentNode);\n container.removeChild(placeholderStyle);\n }\n}\n\n/**\n * manually clear container cache to avoid global cache in unit testes\n */\nexport function clearContainerCache() {\n containerCache.clear();\n}\nexport function updateCSS(css, key) {\n var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var container = getContainer(originOption);\n var styles = findStyles(container);\n var option = _objectSpread(_objectSpread({}, originOption), {}, {\n styles: styles\n });\n\n // Sync real parent\n syncRealContainer(container, option);\n var existNode = findExistNode(key, option);\n if (existNode) {\n var _option$csp, _option$csp2;\n if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {\n var _option$csp3;\n existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;\n }\n if (existNode.innerHTML !== css) {\n existNode.innerHTML = css;\n }\n return existNode;\n }\n var newNode = injectCSS(css, option);\n newNode.setAttribute(getMark(option), key);\n return newNode;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\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 return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n// [times, realValue]\n\nvar SPLIT = '%';\n\n/** Connect key with `SPLIT` */\nexport function pathKey(keys) {\n return keys.join(SPLIT);\n}\nvar Entity = /*#__PURE__*/function () {\n function Entity(instanceId) {\n _classCallCheck(this, Entity);\n _defineProperty(this, \"instanceId\", void 0);\n /** @private Internal cache map. Do not access this directly */\n _defineProperty(this, \"cache\", new Map());\n this.instanceId = instanceId;\n }\n _createClass(Entity, [{\n key: \"get\",\n value: function get(keys) {\n return this.opGet(pathKey(keys));\n }\n\n /** A fast get cache with `get` concat. */\n }, {\n key: \"opGet\",\n value: function opGet(keyPathStr) {\n return this.cache.get(keyPathStr) || null;\n }\n }, {\n key: \"update\",\n value: function update(keys, valueFn) {\n return this.opUpdate(pathKey(keys), valueFn);\n }\n\n /** A fast get cache with `get` concat. */\n }, {\n key: \"opUpdate\",\n value: function opUpdate(keyPathStr, valueFn) {\n var prevValue = this.cache.get(keyPathStr);\n var nextValue = valueFn(prevValue);\n if (nextValue === null) {\n this.cache.delete(keyPathStr);\n } else {\n this.cache.set(keyPathStr, nextValue);\n }\n }\n }]);\n return Entity;\n}();\nexport default Entity;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport useMemo from \"rc-util/es/hooks/useMemo\";\nimport isEqual from \"rc-util/es/isEqual\";\nimport * as React from 'react';\nimport CacheEntity from \"./Cache\";\nexport var ATTR_TOKEN = 'data-token-hash';\nexport var ATTR_MARK = 'data-css-hash';\nexport var ATTR_CACHE_PATH = 'data-cache-path';\n\n// Mark css-in-js instance in style element\nexport var CSS_IN_JS_INSTANCE = '__cssinjs_instance__';\nexport function createCache() {\n var cssinjsInstanceId = Math.random().toString(12).slice(2);\n\n // Tricky SSR: Move all inline style to the head.\n // PS: We do not recommend tricky mode.\n if (typeof document !== 'undefined' && document.head && document.body) {\n var styles = document.body.querySelectorAll(\"style[\".concat(ATTR_MARK, \"]\")) || [];\n var firstChild = document.head.firstChild;\n Array.from(styles).forEach(function (style) {\n style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || cssinjsInstanceId;\n\n // Not force move if no head\n if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {\n document.head.insertBefore(style, firstChild);\n }\n });\n\n // Deduplicate of moved styles\n var styleHash = {};\n Array.from(document.querySelectorAll(\"style[\".concat(ATTR_MARK, \"]\"))).forEach(function (style) {\n var hash = style.getAttribute(ATTR_MARK);\n if (styleHash[hash]) {\n if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {\n var _style$parentNode;\n (_style$parentNode = style.parentNode) === null || _style$parentNode === void 0 || _style$parentNode.removeChild(style);\n }\n } else {\n styleHash[hash] = true;\n }\n });\n }\n return new CacheEntity(cssinjsInstanceId);\n}\nvar StyleContext = /*#__PURE__*/React.createContext({\n hashPriority: 'low',\n cache: createCache(),\n defaultCache: true\n});\nexport var StyleProvider = function StyleProvider(props) {\n var children = props.children,\n restProps = _objectWithoutProperties(props, _excluded);\n var parentContext = React.useContext(StyleContext);\n var context = useMemo(function () {\n var mergedContext = _objectSpread({}, parentContext);\n Object.keys(restProps).forEach(function (key) {\n var value = restProps[key];\n if (restProps[key] !== undefined) {\n mergedContext[key] = value;\n }\n });\n var cache = restProps.cache;\n mergedContext.cache = mergedContext.cache || createCache();\n mergedContext.defaultCache = !cache && parentContext.defaultCache;\n return mergedContext;\n }, [parentContext, restProps], function (prev, next) {\n return !isEqual(prev[0], next[0], true) || !isEqual(prev[1], next[1], true);\n });\n return /*#__PURE__*/React.createElement(StyleContext.Provider, {\n value: context\n }, children);\n};\nexport default StyleContext;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nexport default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n };\n}","import _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nvar AbstractCalculator = /*#__PURE__*/_createClass(function AbstractCalculator() {\n _classCallCheck(this, AbstractCalculator);\n});\nexport default AbstractCalculator;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport AbstractCalculator from \"./calculator\";\nvar CALC_UNIT = 'CALC_UNIT';\nvar regexp = new RegExp(CALC_UNIT, 'g');\nfunction unit(value) {\n if (typeof value === 'number') {\n return \"\".concat(value).concat(CALC_UNIT);\n }\n return value;\n}\nvar CSSCalculator = /*#__PURE__*/function (_AbstractCalculator) {\n _inherits(CSSCalculator, _AbstractCalculator);\n var _super = _createSuper(CSSCalculator);\n function CSSCalculator(num, unitlessCssVar) {\n var _this;\n _classCallCheck(this, CSSCalculator);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"result\", '');\n _defineProperty(_assertThisInitialized(_this), \"unitlessCssVar\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"lowPriority\", void 0);\n var numType = _typeof(num);\n _this.unitlessCssVar = unitlessCssVar;\n if (num instanceof CSSCalculator) {\n _this.result = \"(\".concat(num.result, \")\");\n } else if (numType === 'number') {\n _this.result = unit(num);\n } else if (numType === 'string') {\n _this.result = num;\n }\n return _this;\n }\n _createClass(CSSCalculator, [{\n key: \"add\",\n value: function add(num) {\n if (num instanceof CSSCalculator) {\n this.result = \"\".concat(this.result, \" + \").concat(num.getResult());\n } else if (typeof num === 'number' || typeof num === 'string') {\n this.result = \"\".concat(this.result, \" + \").concat(unit(num));\n }\n this.lowPriority = true;\n return this;\n }\n }, {\n key: \"sub\",\n value: function sub(num) {\n if (num instanceof CSSCalculator) {\n this.result = \"\".concat(this.result, \" - \").concat(num.getResult());\n } else if (typeof num === 'number' || typeof num === 'string') {\n this.result = \"\".concat(this.result, \" - \").concat(unit(num));\n }\n this.lowPriority = true;\n return this;\n }\n }, {\n key: \"mul\",\n value: function mul(num) {\n if (this.lowPriority) {\n this.result = \"(\".concat(this.result, \")\");\n }\n if (num instanceof CSSCalculator) {\n this.result = \"\".concat(this.result, \" * \").concat(num.getResult(true));\n } else if (typeof num === 'number' || typeof num === 'string') {\n this.result = \"\".concat(this.result, \" * \").concat(num);\n }\n this.lowPriority = false;\n return this;\n }\n }, {\n key: \"div\",\n value: function div(num) {\n if (this.lowPriority) {\n this.result = \"(\".concat(this.result, \")\");\n }\n if (num instanceof CSSCalculator) {\n this.result = \"\".concat(this.result, \" / \").concat(num.getResult(true));\n } else if (typeof num === 'number' || typeof num === 'string') {\n this.result = \"\".concat(this.result, \" / \").concat(num);\n }\n this.lowPriority = false;\n return this;\n }\n }, {\n key: \"getResult\",\n value: function getResult(force) {\n return this.lowPriority || force ? \"(\".concat(this.result, \")\") : this.result;\n }\n }, {\n key: \"equal\",\n value: function equal(options) {\n var _this2 = this;\n var _ref = options || {},\n cssUnit = _ref.unit;\n var mergedUnit = true;\n if (typeof cssUnit === 'boolean') {\n mergedUnit = cssUnit;\n } else if (Array.from(this.unitlessCssVar).some(function (cssVar) {\n return _this2.result.includes(cssVar);\n })) {\n mergedUnit = false;\n }\n this.result = this.result.replace(regexp, mergedUnit ? 'px' : '');\n if (typeof this.lowPriority !== 'undefined') {\n return \"calc(\".concat(this.result, \")\");\n }\n return this.result;\n }\n }]);\n return CSSCalculator;\n}(AbstractCalculator);\nexport { CSSCalculator as default };","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport AbstractCalculator from \"./calculator\";\nvar NumCalculator = /*#__PURE__*/function (_AbstractCalculator) {\n _inherits(NumCalculator, _AbstractCalculator);\n var _super = _createSuper(NumCalculator);\n function NumCalculator(num) {\n var _this;\n _classCallCheck(this, NumCalculator);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"result\", 0);\n if (num instanceof NumCalculator) {\n _this.result = num.result;\n } else if (typeof num === 'number') {\n _this.result = num;\n }\n return _this;\n }\n _createClass(NumCalculator, [{\n key: \"add\",\n value: function add(num) {\n if (num instanceof NumCalculator) {\n this.result += num.result;\n } else if (typeof num === 'number') {\n this.result += num;\n }\n return this;\n }\n }, {\n key: \"sub\",\n value: function sub(num) {\n if (num instanceof NumCalculator) {\n this.result -= num.result;\n } else if (typeof num === 'number') {\n this.result -= num;\n }\n return this;\n }\n }, {\n key: \"mul\",\n value: function mul(num) {\n if (num instanceof NumCalculator) {\n this.result *= num.result;\n } else if (typeof num === 'number') {\n this.result *= num;\n }\n return this;\n }\n }, {\n key: \"div\",\n value: function div(num) {\n if (num instanceof NumCalculator) {\n this.result /= num.result;\n } else if (typeof num === 'number') {\n this.result /= num;\n }\n return this;\n }\n }, {\n key: \"equal\",\n value: function equal() {\n return this.result;\n }\n }]);\n return NumCalculator;\n}(AbstractCalculator);\nexport { NumCalculator as default };","import CSSCalculator from \"./CSSCalculator\";\nimport NumCalculator from \"./NumCalculator\";\nvar genCalc = function genCalc(type, unitlessCssVar) {\n var Calculator = type === 'css' ? CSSCalculator : NumCalculator;\n return function (num) {\n return new Calculator(num, unitlessCssVar);\n };\n};\nexport default genCalc;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n// ================================== Cache ==================================\n\nexport function sameDerivativeOption(left, right) {\n if (left.length !== right.length) {\n return false;\n }\n for (var i = 0; i < left.length; i++) {\n if (left[i] !== right[i]) {\n return false;\n }\n }\n return true;\n}\nvar ThemeCache = /*#__PURE__*/function () {\n function ThemeCache() {\n _classCallCheck(this, ThemeCache);\n _defineProperty(this, \"cache\", void 0);\n _defineProperty(this, \"keys\", void 0);\n _defineProperty(this, \"cacheCallTimes\", void 0);\n this.cache = new Map();\n this.keys = [];\n this.cacheCallTimes = 0;\n }\n _createClass(ThemeCache, [{\n key: \"size\",\n value: function size() {\n return this.keys.length;\n }\n }, {\n key: \"internalGet\",\n value: function internalGet(derivativeOption) {\n var _cache2, _cache3;\n var updateCallTimes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var cache = {\n map: this.cache\n };\n derivativeOption.forEach(function (derivative) {\n if (!cache) {\n cache = undefined;\n } else {\n var _cache;\n cache = (_cache = cache) === null || _cache === void 0 || (_cache = _cache.map) === null || _cache === void 0 ? void 0 : _cache.get(derivative);\n }\n });\n if ((_cache2 = cache) !== null && _cache2 !== void 0 && _cache2.value && updateCallTimes) {\n cache.value[1] = this.cacheCallTimes++;\n }\n return (_cache3 = cache) === null || _cache3 === void 0 ? void 0 : _cache3.value;\n }\n }, {\n key: \"get\",\n value: function get(derivativeOption) {\n var _this$internalGet;\n return (_this$internalGet = this.internalGet(derivativeOption, true)) === null || _this$internalGet === void 0 ? void 0 : _this$internalGet[0];\n }\n }, {\n key: \"has\",\n value: function has(derivativeOption) {\n return !!this.internalGet(derivativeOption);\n }\n }, {\n key: \"set\",\n value: function set(derivativeOption, value) {\n var _this = this;\n // New cache\n if (!this.has(derivativeOption)) {\n if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {\n var _this$keys$reduce = this.keys.reduce(function (result, key) {\n var _result = _slicedToArray(result, 2),\n callTimes = _result[1];\n if (_this.internalGet(key)[1] < callTimes) {\n return [key, _this.internalGet(key)[1]];\n }\n return result;\n }, [this.keys[0], this.cacheCallTimes]),\n _this$keys$reduce2 = _slicedToArray(_this$keys$reduce, 1),\n targetKey = _this$keys$reduce2[0];\n this.delete(targetKey);\n }\n this.keys.push(derivativeOption);\n }\n var cache = this.cache;\n derivativeOption.forEach(function (derivative, index) {\n if (index === derivativeOption.length - 1) {\n cache.set(derivative, {\n value: [value, _this.cacheCallTimes++]\n });\n } else {\n var cacheValue = cache.get(derivative);\n if (!cacheValue) {\n cache.set(derivative, {\n map: new Map()\n });\n } else if (!cacheValue.map) {\n cacheValue.map = new Map();\n }\n cache = cache.get(derivative).map;\n }\n });\n }\n }, {\n key: \"deleteByPath\",\n value: function deleteByPath(currentCache, derivatives) {\n var cache = currentCache.get(derivatives[0]);\n if (derivatives.length === 1) {\n var _cache$value;\n if (!cache.map) {\n currentCache.delete(derivatives[0]);\n } else {\n currentCache.set(derivatives[0], {\n map: cache.map\n });\n }\n return (_cache$value = cache.value) === null || _cache$value === void 0 ? void 0 : _cache$value[0];\n }\n var result = this.deleteByPath(cache.map, derivatives.slice(1));\n if ((!cache.map || cache.map.size === 0) && !cache.value) {\n currentCache.delete(derivatives[0]);\n }\n return result;\n }\n }, {\n key: \"delete\",\n value: function _delete(derivativeOption) {\n // If cache exists\n if (this.has(derivativeOption)) {\n this.keys = this.keys.filter(function (item) {\n return !sameDerivativeOption(item, derivativeOption);\n });\n return this.deleteByPath(this.cache, derivativeOption);\n }\n return undefined;\n }\n }]);\n return ThemeCache;\n}();\n_defineProperty(ThemeCache, \"MAX_CACHE_SIZE\", 20);\n_defineProperty(ThemeCache, \"MAX_CACHE_OFFSET\", 5);\nexport { ThemeCache as default };","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { warning } from \"rc-util/es/warning\";\nvar uuid = 0;\n\n/**\n * Theme with algorithms to derive tokens from design tokens.\n * Use `createTheme` first which will help to manage the theme instance cache.\n */\nvar Theme = /*#__PURE__*/function () {\n function Theme(derivatives) {\n _classCallCheck(this, Theme);\n _defineProperty(this, \"derivatives\", void 0);\n _defineProperty(this, \"id\", void 0);\n this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];\n this.id = uuid;\n if (derivatives.length === 0) {\n warning(derivatives.length > 0, '[Ant Design CSS-in-JS] Theme should have at least one derivative function.');\n }\n uuid += 1;\n }\n _createClass(Theme, [{\n key: \"getDerivativeToken\",\n value: function getDerivativeToken(token) {\n return this.derivatives.reduce(function (result, derivative) {\n return derivative(token, result);\n }, undefined);\n }\n }]);\n return Theme;\n}();\nexport { Theme as default };","import ThemeCache from \"./ThemeCache\";\nimport Theme from \"./Theme\";\nvar cacheThemes = new ThemeCache();\n\n/**\n * Same as new Theme, but will always return same one if `derivative` not changed.\n */\nexport default function createTheme(derivatives) {\n var derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];\n // Create new theme if not exist\n if (!cacheThemes.has(derivativeArr)) {\n cacheThemes.set(derivativeArr, new Theme(derivativeArr));\n }\n\n // Get theme from cache and return\n return cacheThemes.get(derivativeArr);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport hash from '@emotion/hash';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport { removeCSS, updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport { ATTR_MARK, ATTR_TOKEN } from \"../StyleContext\";\nimport { Theme } from \"../theme\";\n\n// Create a cache for memo concat\n\nvar resultCache = new WeakMap();\nvar RESULT_VALUE = {};\nexport function memoResult(callback, deps) {\n var current = resultCache;\n for (var i = 0; i < deps.length; i += 1) {\n var dep = deps[i];\n if (!current.has(dep)) {\n current.set(dep, new WeakMap());\n }\n current = current.get(dep);\n }\n if (!current.has(RESULT_VALUE)) {\n current.set(RESULT_VALUE, callback());\n }\n return current.get(RESULT_VALUE);\n}\n\n// Create a cache here to avoid always loop generate\nvar flattenTokenCache = new WeakMap();\n\n/**\n * Flatten token to string, this will auto cache the result when token not change\n */\nexport function flattenToken(token) {\n var hashed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var str = flattenTokenCache.get(token) || '';\n if (!str) {\n Object.keys(token).forEach(function (key) {\n var value = token[key];\n str += key;\n if (value instanceof Theme) {\n str += value.id;\n } else if (value && _typeof(value) === 'object') {\n str += flattenToken(value, hashed);\n } else {\n str += value;\n }\n });\n\n // https://github.com/ant-design/ant-design/issues/48386\n // Should hash the string to avoid style tag name too long\n if (hashed) {\n str = hash(str);\n }\n\n // Put in cache\n flattenTokenCache.set(token, str);\n }\n return str;\n}\n\n/**\n * Convert derivative token to key string\n */\nexport function token2key(token, salt) {\n return hash(\"\".concat(salt, \"_\").concat(flattenToken(token, true)));\n}\nvar randomSelectorKey = \"random-\".concat(Date.now(), \"-\").concat(Math.random()).replace(/\\./g, '');\n\n// Magic `content` for detect selector support\nvar checkContent = '_bAmBoO_';\nfunction supportSelector(styleStr, handleElement, supportCheck) {\n if (canUseDom()) {\n var _getComputedStyle$con, _ele$parentNode;\n updateCSS(styleStr, randomSelectorKey);\n var _ele = document.createElement('div');\n _ele.style.position = 'fixed';\n _ele.style.left = '0';\n _ele.style.top = '0';\n handleElement === null || handleElement === void 0 || handleElement(_ele);\n document.body.appendChild(_ele);\n if (process.env.NODE_ENV !== 'production') {\n _ele.innerHTML = 'Test';\n _ele.style.zIndex = '9999999';\n }\n var support = supportCheck ? supportCheck(_ele) : (_getComputedStyle$con = getComputedStyle(_ele).content) === null || _getComputedStyle$con === void 0 ? void 0 : _getComputedStyle$con.includes(checkContent);\n (_ele$parentNode = _ele.parentNode) === null || _ele$parentNode === void 0 || _ele$parentNode.removeChild(_ele);\n removeCSS(randomSelectorKey);\n return support;\n }\n return false;\n}\nvar canLayer = undefined;\nexport function supportLayer() {\n if (canLayer === undefined) {\n canLayer = supportSelector(\"@layer \".concat(randomSelectorKey, \" { .\").concat(randomSelectorKey, \" { content: \\\"\").concat(checkContent, \"\\\"!important; } }\"), function (ele) {\n ele.className = randomSelectorKey;\n });\n }\n return canLayer;\n}\nvar canWhere = undefined;\nexport function supportWhere() {\n if (canWhere === undefined) {\n canWhere = supportSelector(\":where(.\".concat(randomSelectorKey, \") { content: \\\"\").concat(checkContent, \"\\\"!important; }\"), function (ele) {\n ele.className = randomSelectorKey;\n });\n }\n return canWhere;\n}\nvar canLogic = undefined;\nexport function supportLogicProps() {\n if (canLogic === undefined) {\n canLogic = supportSelector(\".\".concat(randomSelectorKey, \" { inset-block: 93px !important; }\"), function (ele) {\n ele.className = randomSelectorKey;\n }, function (ele) {\n return getComputedStyle(ele).bottom === '93px';\n });\n }\n return canLogic;\n}\nexport var isClientSide = canUseDom();\nexport function unit(num) {\n if (typeof num === 'number') {\n return \"\".concat(num, \"px\");\n }\n return num;\n}\nexport function toStyleStr(style, tokenKey, styleId) {\n var customizeAttrs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var plain = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n if (plain) {\n return style;\n }\n var attrs = _objectSpread(_objectSpread({}, customizeAttrs), {}, _defineProperty(_defineProperty({}, ATTR_TOKEN, tokenKey), ATTR_MARK, styleId));\n var attrStr = Object.keys(attrs).map(function (attr) {\n var val = attrs[attr];\n return val ? \"\".concat(attr, \"=\\\"\").concat(val, \"\\\"\") : null;\n }).filter(function (v) {\n return v;\n }).join(' ');\n return \"\");\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nexport var token2CSSVar = function token2CSSVar(token) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return \"--\".concat(prefix ? \"\".concat(prefix, \"-\") : '').concat(token).replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/([A-Z]+)([A-Z][a-z0-9]+)/g, '$1-$2').replace(/([a-z])([A-Z0-9])/g, '$1-$2').toLowerCase();\n};\nexport var serializeCSSVar = function serializeCSSVar(cssVars, hashId, options) {\n if (!Object.keys(cssVars).length) {\n return '';\n }\n return \".\".concat(hashId).concat(options !== null && options !== void 0 && options.scope ? \".\".concat(options.scope) : '', \"{\").concat(Object.entries(cssVars).map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n return \"\".concat(key, \":\").concat(value, \";\");\n }).join(''), \"}\");\n};\nexport var transformToken = function transformToken(token, themeKey, config) {\n var cssVars = {};\n var result = {};\n Object.entries(token).forEach(function (_ref3) {\n var _config$preserve, _config$ignore;\n var _ref4 = _slicedToArray(_ref3, 2),\n key = _ref4[0],\n value = _ref4[1];\n if (config !== null && config !== void 0 && (_config$preserve = config.preserve) !== null && _config$preserve !== void 0 && _config$preserve[key]) {\n result[key] = value;\n } else if ((typeof value === 'string' || typeof value === 'number') && !(config !== null && config !== void 0 && (_config$ignore = config.ignore) !== null && _config$ignore !== void 0 && _config$ignore[key])) {\n var _config$unitless;\n var cssVar = token2CSSVar(key, config === null || config === void 0 ? void 0 : config.prefix);\n cssVars[cssVar] = typeof value === 'number' && !(config !== null && config !== void 0 && (_config$unitless = config.unitless) !== null && _config$unitless !== void 0 && _config$unitless[key]) ? \"\".concat(value, \"px\") : String(value);\n result[key] = \"var(\".concat(cssVar, \")\");\n }\n });\n return [result, serializeCSSVar(cssVars, themeKey, {\n scope: config === null || config === void 0 ? void 0 : config.scope\n })];\n};","import * as React from 'react';\nimport canUseDom from \"../Dom/canUseDom\";\n\n/**\n * Wrap `React.useLayoutEffect` which will not throw warning message in test env\n */\nvar useInternalLayoutEffect = process.env.NODE_ENV !== 'test' && canUseDom() ? React.useLayoutEffect : React.useEffect;\nvar useLayoutEffect = function useLayoutEffect(callback, deps) {\n var firstMountRef = React.useRef(true);\n useInternalLayoutEffect(function () {\n return callback(firstMountRef.current);\n }, deps);\n\n // We tell react that first mount has passed\n useInternalLayoutEffect(function () {\n firstMountRef.current = false;\n return function () {\n firstMountRef.current = true;\n };\n }, []);\n};\nexport var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {\n useLayoutEffect(function (firstMount) {\n if (!firstMount) {\n return callback();\n }\n }, deps);\n};\nexport default useLayoutEffect;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// import canUseDom from 'rc-util/lib/Dom/canUseDom';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport * as React from 'react';\n\n// We need fully clone React function here\n// to avoid webpack warning React 17 do not export `useId`\nvar fullClone = _objectSpread({}, React);\nvar useInsertionEffect = fullClone.useInsertionEffect;\n/**\n * Polyfill `useInsertionEffect` for React < 18\n * @param renderEffect will be executed in `useMemo`, and do not have callback\n * @param effect will be executed in `useLayoutEffect`\n * @param deps\n */\nvar useInsertionEffectPolyfill = function useInsertionEffectPolyfill(renderEffect, effect, deps) {\n React.useMemo(renderEffect, deps);\n useLayoutEffect(function () {\n return effect(true);\n }, deps);\n};\n\n/**\n * Compatible `useInsertionEffect`\n * will use `useInsertionEffect` if React version >= 18,\n * otherwise use `useInsertionEffectPolyfill`.\n */\nvar useCompatibleInsertionEffect = useInsertionEffect ? function (renderEffect, effect, deps) {\n return useInsertionEffect(function () {\n renderEffect();\n return effect();\n }, deps);\n} : useInsertionEffectPolyfill;\nexport default useCompatibleInsertionEffect;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { warning } from \"rc-util/es/warning\";\nimport * as React from 'react';\nvar fullClone = _objectSpread({}, React);\nvar useInsertionEffect = fullClone.useInsertionEffect;\n\n// DO NOT register functions in useEffect cleanup function, or functions that registered will never be called.\nvar useCleanupRegister = function useCleanupRegister(deps) {\n var effectCleanups = [];\n var cleanupFlag = false;\n function register(fn) {\n if (cleanupFlag) {\n if (process.env.NODE_ENV !== 'production') {\n warning(false, '[Ant Design CSS-in-JS] You are registering a cleanup function after unmount, which will not have any effect.');\n }\n return;\n }\n effectCleanups.push(fn);\n }\n React.useEffect(function () {\n // Compatible with strict mode\n cleanupFlag = false;\n return function () {\n cleanupFlag = true;\n if (effectCleanups.length) {\n effectCleanups.forEach(function (fn) {\n return fn();\n });\n }\n };\n }, deps);\n return register;\n};\nvar useRun = function useRun() {\n return function (fn) {\n fn();\n };\n};\n\n// Only enable register in React 18\nvar useEffectCleanupRegister = typeof useInsertionEffect !== 'undefined' ? useCleanupRegister : useRun;\nexport default useEffectCleanupRegister;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport * as React from 'react';\nimport { pathKey } from \"../Cache\";\nimport StyleContext from \"../StyleContext\";\nimport useCompatibleInsertionEffect from \"./useCompatibleInsertionEffect\";\nimport useEffectCleanupRegister from \"./useEffectCleanupRegister\";\nimport useHMR from \"./useHMR\";\nexport default function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove,\n// Add additional effect trigger by `useInsertionEffect`\nonCacheEffect) {\n var _React$useContext = React.useContext(StyleContext),\n globalCache = _React$useContext.cache;\n var fullPath = [prefix].concat(_toConsumableArray(keyPath));\n var fullPathStr = pathKey(fullPath);\n var register = useEffectCleanupRegister([fullPathStr]);\n var HMRUpdate = useHMR();\n var buildCache = function buildCache(updater) {\n globalCache.opUpdate(fullPathStr, function (prevCache) {\n var _ref = prevCache || [undefined, undefined],\n _ref2 = _slicedToArray(_ref, 2),\n _ref2$ = _ref2[0],\n times = _ref2$ === void 0 ? 0 : _ref2$,\n cache = _ref2[1];\n\n // HMR should always ignore cache since developer may change it\n var tmpCache = cache;\n if (process.env.NODE_ENV !== 'production' && cache && HMRUpdate) {\n onCacheRemove === null || onCacheRemove === void 0 || onCacheRemove(tmpCache, HMRUpdate);\n tmpCache = null;\n }\n var mergedCache = tmpCache || cacheFn();\n var data = [times, mergedCache];\n\n // Call updater if need additional logic\n return updater ? updater(data) : data;\n });\n };\n\n // Create cache\n React.useMemo(function () {\n buildCache();\n }, /* eslint-disable react-hooks/exhaustive-deps */\n [fullPathStr]\n /* eslint-enable */);\n var cacheEntity = globalCache.opGet(fullPathStr);\n\n // HMR clean the cache but not trigger `useMemo` again\n // Let's fallback of this\n // ref https://github.com/ant-design/cssinjs/issues/127\n if (process.env.NODE_ENV !== 'production' && !cacheEntity) {\n buildCache();\n cacheEntity = globalCache.opGet(fullPathStr);\n }\n var cacheContent = cacheEntity[1];\n\n // Remove if no need anymore\n useCompatibleInsertionEffect(function () {\n onCacheEffect === null || onCacheEffect === void 0 || onCacheEffect(cacheContent);\n }, function (polyfill) {\n // It's bad to call build again in effect.\n // But we have to do this since StrictMode will call effect twice\n // which will clear cache on the first time.\n buildCache(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n times = _ref4[0],\n cache = _ref4[1];\n if (polyfill && times === 0) {\n onCacheEffect === null || onCacheEffect === void 0 || onCacheEffect(cacheContent);\n }\n return [times + 1, cache];\n });\n return function () {\n globalCache.opUpdate(fullPathStr, function (prevCache) {\n var _ref5 = prevCache || [],\n _ref6 = _slicedToArray(_ref5, 2),\n _ref6$ = _ref6[0],\n times = _ref6$ === void 0 ? 0 : _ref6$,\n cache = _ref6[1];\n var nextCount = times - 1;\n if (nextCount === 0) {\n // Always remove styles in useEffect callback\n register(function () {\n // With polyfill, registered callback will always be called synchronously\n // But without polyfill, it will be called in effect clean up,\n // And by that time this cache is cleaned up.\n if (polyfill || !globalCache.opGet(fullPathStr)) {\n onCacheRemove === null || onCacheRemove === void 0 || onCacheRemove(cache, false);\n }\n });\n return null;\n }\n return [times - 1, cache];\n });\n };\n }, [fullPathStr]);\n return cacheContent;\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport hash from '@emotion/hash';\nimport { updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport { useContext } from 'react';\nimport StyleContext, { ATTR_MARK, ATTR_TOKEN, CSS_IN_JS_INSTANCE } from \"../StyleContext\";\nimport { flattenToken, memoResult, token2key, toStyleStr } from \"../util\";\nimport { transformToken } from \"../util/css-variables\";\nimport useGlobalCache from \"./useGlobalCache\";\nvar EMPTY_OVERRIDE = {};\n\n// Generate different prefix to make user selector break in production env.\n// This helps developer not to do style override directly on the hash id.\nvar hashPrefix = process.env.NODE_ENV !== 'production' ? 'css-dev-only-do-not-override' : 'css';\nvar tokenKeys = new Map();\nfunction recordCleanToken(tokenKey) {\n tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);\n}\nfunction removeStyleTags(key, instanceId) {\n if (typeof document !== 'undefined') {\n var styles = document.querySelectorAll(\"style[\".concat(ATTR_TOKEN, \"=\\\"\").concat(key, \"\\\"]\"));\n styles.forEach(function (style) {\n if (style[CSS_IN_JS_INSTANCE] === instanceId) {\n var _style$parentNode;\n (_style$parentNode = style.parentNode) === null || _style$parentNode === void 0 || _style$parentNode.removeChild(style);\n }\n });\n }\n}\nvar TOKEN_THRESHOLD = 0;\n\n// Remove will check current keys first\nfunction cleanTokenStyle(tokenKey, instanceId) {\n tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);\n var tokenKeyList = Array.from(tokenKeys.keys());\n var cleanableKeyList = tokenKeyList.filter(function (key) {\n var count = tokenKeys.get(key) || 0;\n return count <= 0;\n });\n\n // Should keep tokens under threshold for not to insert style too often\n if (tokenKeyList.length - cleanableKeyList.length > TOKEN_THRESHOLD) {\n cleanableKeyList.forEach(function (key) {\n removeStyleTags(key, instanceId);\n tokenKeys.delete(key);\n });\n }\n}\nexport var getComputedToken = function getComputedToken(originToken, overrideToken, theme, format) {\n var derivativeToken = theme.getDerivativeToken(originToken);\n\n // Merge with override\n var mergedDerivativeToken = _objectSpread(_objectSpread({}, derivativeToken), overrideToken);\n\n // Format if needed\n if (format) {\n mergedDerivativeToken = format(mergedDerivativeToken);\n }\n return mergedDerivativeToken;\n};\nexport var TOKEN_PREFIX = 'token';\n/**\n * Cache theme derivative token as global shared one\n * @param theme Theme entity\n * @param tokens List of tokens, used for cache. Please do not dynamic generate object directly\n * @param option Additional config\n * @returns Call Theme.getDerivativeToken(tokenObject) to get token\n */\nexport default function useCacheToken(theme, tokens) {\n var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var _useContext = useContext(StyleContext),\n instanceId = _useContext.cache.instanceId,\n container = _useContext.container;\n var _option$salt = option.salt,\n salt = _option$salt === void 0 ? '' : _option$salt,\n _option$override = option.override,\n override = _option$override === void 0 ? EMPTY_OVERRIDE : _option$override,\n formatToken = option.formatToken,\n compute = option.getComputedToken,\n cssVar = option.cssVar;\n\n // Basic - We do basic cache here\n var mergedToken = memoResult(function () {\n return Object.assign.apply(Object, [{}].concat(_toConsumableArray(tokens)));\n }, tokens);\n var tokenStr = flattenToken(mergedToken);\n var overrideTokenStr = flattenToken(override);\n var cssVarStr = cssVar ? flattenToken(cssVar) : '';\n var cachedToken = useGlobalCache(TOKEN_PREFIX, [salt, theme.id, tokenStr, overrideTokenStr, cssVarStr], function () {\n var _cssVar$key;\n var mergedDerivativeToken = compute ? compute(mergedToken, override, theme) : getComputedToken(mergedToken, override, theme, formatToken);\n\n // Replace token value with css variables\n var actualToken = _objectSpread({}, mergedDerivativeToken);\n var cssVarsStr = '';\n if (!!cssVar) {\n var _transformToken = transformToken(mergedDerivativeToken, cssVar.key, {\n prefix: cssVar.prefix,\n ignore: cssVar.ignore,\n unitless: cssVar.unitless,\n preserve: cssVar.preserve\n });\n var _transformToken2 = _slicedToArray(_transformToken, 2);\n mergedDerivativeToken = _transformToken2[0];\n cssVarsStr = _transformToken2[1];\n }\n\n // Optimize for `useStyleRegister` performance\n var tokenKey = token2key(mergedDerivativeToken, salt);\n mergedDerivativeToken._tokenKey = tokenKey;\n actualToken._tokenKey = token2key(actualToken, salt);\n var themeKey = (_cssVar$key = cssVar === null || cssVar === void 0 ? void 0 : cssVar.key) !== null && _cssVar$key !== void 0 ? _cssVar$key : tokenKey;\n mergedDerivativeToken._themeKey = themeKey;\n recordCleanToken(themeKey);\n var hashId = \"\".concat(hashPrefix, \"-\").concat(hash(tokenKey));\n mergedDerivativeToken._hashId = hashId; // Not used\n\n return [mergedDerivativeToken, hashId, actualToken, cssVarsStr, (cssVar === null || cssVar === void 0 ? void 0 : cssVar.key) || ''];\n }, function (cache) {\n // Remove token will remove all related style\n cleanTokenStyle(cache[0]._themeKey, instanceId);\n }, function (_ref) {\n var _ref2 = _slicedToArray(_ref, 4),\n token = _ref2[0],\n cssVarsStr = _ref2[3];\n if (cssVar && cssVarsStr) {\n var style = updateCSS(cssVarsStr, hash(\"css-variables-\".concat(token._themeKey)), {\n mark: ATTR_MARK,\n prepend: 'queue',\n attachTo: container,\n priority: -999\n });\n style[CSS_IN_JS_INSTANCE] = instanceId;\n\n // Used for `useCacheToken` to remove on batch when token removed\n style.setAttribute(ATTR_TOKEN, token._themeKey);\n }\n });\n return cachedToken;\n}\nexport var extract = function extract(cache, effectStyles, options) {\n var _cache = _slicedToArray(cache, 5),\n realToken = _cache[2],\n styleStr = _cache[3],\n cssVarKey = _cache[4];\n var _ref3 = options || {},\n plain = _ref3.plain;\n if (!styleStr) {\n return null;\n }\n var styleId = realToken._tokenKey;\n var order = -999;\n\n // ====================== Style ======================\n // Used for rc-util\n var sharedAttrs = {\n 'data-rc-order': 'prependQueue',\n 'data-rc-priority': \"\".concat(order)\n };\n var styleText = toStyleStr(styleStr, cssVarKey, styleId, sharedAttrs, plain);\n return [order, styleId, styleText];\n};","export default function _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}","var unitlessKeys = {\n animationIterationCount: 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 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 default unitlessKeys;\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","/**\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\n/**\n * @param {string[]} array\n * @param {RegExp} pattern\n * @return {string[]}\n */\nexport function filter (array, pattern) {\n\treturn array.filter(function (value) { return !match(value, pattern) })\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 {object[]} siblings\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length, siblings) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: '', siblings: siblings}\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.siblings), root, {length: -root.length}, props)\n}\n\n/**\n * @param {object} root\n */\nexport function lift (root) {\n\twhile (root.root)\n\t\troot = copy(root.root, {children: [root]})\n\n\tappend(root, root.siblings)\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","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), 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, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), 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), 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), 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 * @param {object[]} siblings\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {\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, siblings)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @param {object[]} siblings\n * @return {object}\n */\nexport function comment (value, root, parent, siblings) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function declaration (value, root, parent, length, siblings) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen} 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\n\tfor (var i = 0; i < children.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: if (!strlen(element.value = element.props.join(','))) return ''\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport { ATTR_MARK } from \"../StyleContext\";\nexport var ATTR_CACHE_MAP = 'data-ant-cssinjs-cache-path';\n\n/**\n * This marks style from the css file.\n * Which means not exist in `\"},this.getStyleTags=function(){return e.sealed?D(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return D(2);var n=((t={})[N]=\"\",t[\"data-styled-version\"]=\"5.3.11\",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=Y();return o&&(n.nonce=o),[r.createElement(\"style\",y({},n,{key:\"sc-0-0\"}))]},this.seal=function(){e.sealed=!0},this.instance=new X({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?D(2):r.createElement(me,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return D(3)},e}(),Je=function(e){var t=r.forwardRef((function(t,n){var o=s(Me),i=e.defaultProps,a=Oe(t,o,i);return\"production\"!==process.env.NODE_ENV&&void 0===a&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"'+b(e)+'\"'),r.createElement(e,y({},t,{theme:a,ref:n}))}));return m(t,e),t.displayName=\"WithTheme(\"+b(e)+\")\",t},Xe=function(){return s(Me)},Ze={StyleSheet:X,masterSheet:de};\"production\"!==process.env.NODE_ENV&&\"undefined\"!=typeof navigator&&\"ReactNative\"===navigator.product&&console.warn(\"It looks like you've imported 'styled-components' on React Native.\\nPerhaps you're looking to import 'styled-components/native'?\\nRead more about this at https://www.styled-components.com/docs/basics#react-native\"),\"production\"!==process.env.NODE_ENV&&\"test\"!==process.env.NODE_ENV&&\"undefined\"!=typeof window&&(window[\"__styled-components-init__\"]=window[\"__styled-components-init__\"]||0,1===window[\"__styled-components-init__\"]&&console.warn(\"It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\\n\\nSee https://s-c.sh/2BAXzed for more info.\"),window[\"__styled-components-init__\"]+=1);export default qe;export{Ue as ServerStyleSheet,ue as StyleSheetConsumer,ce as StyleSheetContext,me as StyleSheetManager,Ge as ThemeConsumer,Me as ThemeContext,Le as ThemeProvider,Ze as __PRIVATE__,$e as createGlobalStyle,Ae as css,_ as isStyledComponent,We as keyframes,Xe as useTheme,A as version,Je as withTheme};\n//# sourceMappingURL=styled-components.browser.esm.js.map\n","export enum Routes {\n LOGIN = '/login',\n DASHBOARD = '/',\n ATTRIBUTION = '/attribution',\n REGISTER = '/register',\n PASSWORD_RESET = '/password-reset',\n PASSWORD_RESET_VERIFY_ACCOUNT = '/password-reset/verify-account',\n PASSWORD_RESET_SEND_CODE = '/password-reset/send-code',\n PASSWORD_RESET_VERIFY_CODE = '/password-reset/verify-code',\n PASSWORD_RESET_NEW_PASSWORD = '/password-reset/new-password',\n CREATE_ORGANIZATION = '/create-organization',\n CREATE_STORE = '/create-store',\n CONNECTIONS = '/connections',\n PROFILE = '/profile',\n QUICK_START = '/quick-start',\n CONNECT_ACCOUNTS = '/quick-start/connect-accounts',\n CHOOSE_YOUR_SUBSCRIPTION = '/quick-start/choose-your-subscription',\n SETUP_OUR_PIXEL = '/quick-start/setup-our-pixel',\n SETUP_UTM = '/setup-utm',\n SETTINGS = '/settings',\n SUBSCRIPTION = '/subscription',\n PROFILE_SETTINGS = '/general-settings/profile',\n SUPPORT_SETTINGS = '/general-settings/support',\n SUBSCRIPTION_SETTINGS = '/general-settings/subscription',\n SETUP_TRACKING = '/setup-tracking',\n LEGAL = '/legal',\n REFUND_POLICY = '/legal/refund-policy',\n TERMS_OF_SERVICE = '/legal/terms-of-service',\n PRIVACY_POLICY = '/legal/privacy-policy',\n}\n","import React from 'react';\nimport { useRouteError, Link } from \"react-router-dom\";\nimport { theme, Button, Result as _Result, Space, Typography } from 'antd';\nimport styled from 'styled-components';\nimport { Routes } from '../../Routes';\nimport { ResultStatusType } from 'antd/es/result';\n\nconst { Title } = Typography;\n\nconst Result = styled(_Result)`\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n & .ant-result-image {\n margin-bottom: 0;\n margin 0;\n }\n`;\n\ninterface ErrorProps {\n statusText?: string;\n message?: string;\n status?: ResultStatusType;\n}\n\nexport const ErrorBoundary = () => {\n const {\n token: { colorBgContainer },\n } = theme.useToken();\n const error = useRouteError() as ErrorProps;\n console.error(error);\n\n const Extra = (\n \n {(error?.statusText ?? error?.message) ?? \"Unknown Error\"}\n \n \n );\n\n return (\n \n );\n};","import { createContext } from 'react';\nvar IconContext = /*#__PURE__*/createContext({});\nexport default IconContext;","/**\n * Take input from [0, n] and return it as [0, 1]\n * @hidden\n */\nexport function bound01(n, max) {\n if (isOnePointZero(n)) {\n n = '100%';\n }\n var isPercent = isPercentage(n);\n n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));\n // Automatically convert percentage into number\n if (isPercent) {\n n = parseInt(String(n * max), 10) / 100;\n }\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n // Convert into [0, 1] range if it isn't already\n if (max === 360) {\n // If n is a hue given in degrees,\n // wrap around out-of-range values into [0, 360] range\n // then convert into [0, 1].\n n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));\n }\n else {\n // If n not a hue given in degrees\n // Convert into [0, 1] range if it isn't already.\n n = (n % max) / parseFloat(String(max));\n }\n return n;\n}\n/**\n * Force a number between 0 and 1\n * @hidden\n */\nexport function clamp01(val) {\n return Math.min(1, Math.max(0, val));\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 * \n * @hidden\n */\nexport function 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\n * @hidden\n */\nexport function isPercentage(n) {\n return typeof n === 'string' && n.indexOf('%') !== -1;\n}\n/**\n * Return a valid alpha value [0,1] with all invalid values being set to 1\n * @hidden\n */\nexport function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n}\n/**\n * Replace a decimal with it's percentage value\n * @hidden\n */\nexport function convertToPercentage(n) {\n if (n <= 1) {\n return \"\".concat(Number(n) * 100, \"%\");\n }\n return n;\n}\n/**\n * Force a hex value to have 2 characters\n * @hidden\n */\nexport function pad2(c) {\n return c.length === 1 ? '0' + c : String(c);\n}\n","import { bound01, pad2 } from './util';\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// \n/**\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]\n */\nexport function 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 * 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]\n */\nexport function 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 var min = Math.min(r, g, b);\n var h = 0;\n var s = 0;\n var l = (max + min) / 2;\n if (max === min) {\n s = 0;\n h = 0; // achromatic\n }\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 default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, l: l };\n}\nfunction hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * (6 * t);\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n}\n/**\n * Converts an HSL color value to RGB.\n *\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]\n */\nexport function hslToRgb(h, s, l) {\n var r;\n var g;\n var b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n if (s === 0) {\n // achromatic\n g = l;\n b = l;\n r = l;\n }\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 { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color value to HSV\n *\n * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n * *Returns:* { h, s, v } in [0,1]\n */\nexport function 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 var min = Math.min(r, g, b);\n var h = 0;\n var v = max;\n var d = max - min;\n var s = max === 0 ? 0 : d / max;\n if (max === min) {\n h = 0; // achromatic\n }\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 default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n/**\n * Converts an HSV color value to RGB.\n *\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]\n */\nexport function 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 var f = h - i;\n var p = v * (1 - s);\n var q = v * (1 - f * s);\n var t = v * (1 - (1 - f) * s);\n var mod = i % 6;\n var r = [v, q, p, p, t, v][mod];\n var g = [t, v, v, q, p, p][mod];\n var b = [p, p, t, v, v, q][mod];\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color to hex\n *\n * Assumes r, g, and b are contained in the set [0, 255]\n * Returns a 3 or 6 character hex\n */\nexport function rgbToHex(r, g, b, allow3Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n // Return a 3 character hex if possible\n if (allow3Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(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 * Converts an RGBA color plus alpha transparency to hex\n *\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\n */\n// eslint-disable-next-line max-params\nexport function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n pad2(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(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 * Converts an RGBA color to an ARGB Hex8 string\n * Rarely used, but required for \"toFilter()\"\n */\nexport function rgbaToArgbHex(r, g, b, a) {\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n return hex.join('');\n}\n/** Converts a decimal to a hex value */\nexport function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n/** Converts a hex value to a decimal */\nexport function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}\n/** Parse a base-16 hex value into a base-10 integer */\nexport function parseIntFromHex(val) {\n return parseInt(val, 16);\n}\nexport function numberInputToObject(color) {\n return {\n r: color >> 16,\n g: (color & 0xff00) >> 8,\n b: color & 0xff,\n };\n}\n","// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json\n/**\n * @hidden\n */\nexport var names = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\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: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n goldenrod: '#daa520',\n gold: '#ffd700',\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 lavenderblush: '#fff0f5',\n lavender: '#e6e6fa',\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: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\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: '#ff0000',\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: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n","/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport { convertHexToDecimal, hslToRgb, hsvToRgb, parseIntFromHex, rgbToRgb } from './conversion';\nimport { names } from './css-color-names';\nimport { boundAlpha, convertToPercentage } from './util';\n/**\n * Given a string or object, convert that input to RGB\n *\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 * ```\n */\nexport function inputToRGB(color) {\n var rgb = { r: 0, g: 0, b: 0 };\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 }\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 }\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 (Object.prototype.hasOwnProperty.call(color, '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// \nvar CSS_INTEGER = '[-\\\\+]?\\\\d+%?';\n// \nvar CSS_NUMBER = '[-\\\\+]?\\\\d*\\\\.\\\\d+%?';\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\nvar CSS_UNIT = \"(?:\".concat(CSS_NUMBER, \")|(?:\").concat(CSS_INTEGER, \")\");\n// Actual matching.\n// Parentheses and commas are optional, but not required.\n// Whitespace can take the place of commas or opening paren\nvar PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar matchers = {\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 * 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}`\n */\nexport function stringInputToObject(color) {\n color = color.trim().toLowerCase();\n if (color.length === 0) {\n return false;\n }\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: 'name' };\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 = matchers.rgb.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n match = matchers.rgba.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n match = matchers.hsl.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n match = matchers.hsla.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n match = matchers.hsv.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n match = matchers.hsva.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n match = matchers.hex8.exec(color);\n if (match) {\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 match = matchers.hex6.exec(color);\n if (match) {\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 match = matchers.hex4.exec(color);\n if (match) {\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 match = matchers.hex3.exec(color);\n if (match) {\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}\n/**\n * Check to see if it looks like a CSS unit\n * (see `matchers` above for definition).\n */\nexport function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}\n","import { inputToRGB, rgbToHex, rgbToHsv } from '@ctrl/tinycolor';\n\nvar hueStep = 2; // 色相阶梯\n\nvar saturationStep = 0.16; // 饱和度阶梯,浅色部分\n\nvar saturationStep2 = 0.05; // 饱和度阶梯,深色部分\n\nvar brightnessStep1 = 0.05; // 亮度阶梯,浅色部分\n\nvar brightnessStep2 = 0.15; // 亮度阶梯,深色部分\n\nvar lightColorCount = 5; // 浅色数量,主色上\n\nvar darkColorCount = 4; // 深色数量,主色下\n// 暗色主题颜色映射关系表\n\nvar darkColorMap = [{\n index: 7,\n opacity: 0.15\n}, {\n index: 6,\n opacity: 0.25\n}, {\n index: 5,\n opacity: 0.3\n}, {\n index: 5,\n opacity: 0.45\n}, {\n index: 5,\n opacity: 0.65\n}, {\n index: 5,\n opacity: 0.85\n}, {\n index: 4,\n opacity: 0.9\n}, {\n index: 3,\n opacity: 0.95\n}, {\n index: 2,\n opacity: 0.97\n}, {\n index: 1,\n opacity: 0.98\n}]; // Wrapper function ported from TinyColor.prototype.toHsv\n// Keep it here because of `hsv.h * 360`\n\nfunction toHsv(_ref) {\n var r = _ref.r,\n g = _ref.g,\n b = _ref.b;\n var hsv = rgbToHsv(r, g, b);\n return {\n h: hsv.h * 360,\n s: hsv.s,\n v: hsv.v\n };\n} // Wrapper function ported from TinyColor.prototype.toHexString\n// Keep it here because of the prefix `#`\n\n\nfunction toHex(_ref2) {\n var r = _ref2.r,\n g = _ref2.g,\n b = _ref2.b;\n return \"#\".concat(rgbToHex(r, g, b, false));\n} // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.\n// Amount in range [0, 1]\n// Assume color1 & color2 has no alpha, since the following src code did so.\n\n\nfunction mix(rgb1, rgb2, amount) {\n var p = amount / 100;\n var rgb = {\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 };\n return rgb;\n}\n\nfunction getHue(hsv, i, light) {\n var hue; // 根据色相不同,色相转向不同\n\n if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {\n hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;\n } else {\n hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;\n }\n\n if (hue < 0) {\n hue += 360;\n } else if (hue >= 360) {\n hue -= 360;\n }\n\n return hue;\n}\n\nfunction getSaturation(hsv, i, light) {\n // grey color don't change saturation\n if (hsv.h === 0 && hsv.s === 0) {\n return hsv.s;\n }\n\n var saturation;\n\n if (light) {\n saturation = hsv.s - saturationStep * i;\n } else if (i === darkColorCount) {\n saturation = hsv.s + saturationStep;\n } else {\n saturation = hsv.s + saturationStep2 * i;\n } // 边界值修正\n\n\n if (saturation > 1) {\n saturation = 1;\n } // 第一格的 s 限制在 0.06-0.1 之间\n\n\n if (light && i === lightColorCount && saturation > 0.1) {\n saturation = 0.1;\n }\n\n if (saturation < 0.06) {\n saturation = 0.06;\n }\n\n return Number(saturation.toFixed(2));\n}\n\nfunction getValue(hsv, i, light) {\n var value;\n\n if (light) {\n value = hsv.v + brightnessStep1 * i;\n } else {\n value = hsv.v - brightnessStep2 * i;\n }\n\n if (value > 1) {\n value = 1;\n }\n\n return Number(value.toFixed(2));\n}\n\nfunction generate(color) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var patterns = [];\n var pColor = inputToRGB(color);\n\n for (var i = lightColorCount; i > 0; i -= 1) {\n var hsv = toHsv(pColor);\n var colorString = toHex(inputToRGB({\n h: getHue(hsv, i, true),\n s: getSaturation(hsv, i, true),\n v: getValue(hsv, i, true)\n }));\n patterns.push(colorString);\n }\n\n patterns.push(toHex(pColor));\n\n for (var _i = 1; _i <= darkColorCount; _i += 1) {\n var _hsv = toHsv(pColor);\n\n var _colorString = toHex(inputToRGB({\n h: getHue(_hsv, _i),\n s: getSaturation(_hsv, _i),\n v: getValue(_hsv, _i)\n }));\n\n patterns.push(_colorString);\n } // dark theme patterns\n\n\n if (opts.theme === 'dark') {\n return darkColorMap.map(function (_ref3) {\n var index = _ref3.index,\n opacity = _ref3.opacity;\n var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));\n return darkColorString;\n });\n }\n\n return patterns;\n}\n\nvar presetPrimaryColors = {\n red: '#F5222D',\n volcano: '#FA541C',\n orange: '#FA8C16',\n gold: '#FAAD14',\n yellow: '#FADB14',\n lime: '#A0D911',\n green: '#52C41A',\n cyan: '#13C2C2',\n blue: '#1890FF',\n geekblue: '#2F54EB',\n purple: '#722ED1',\n magenta: '#EB2F96',\n grey: '#666666'\n};\nvar presetPalettes = {};\nvar presetDarkPalettes = {};\nObject.keys(presetPrimaryColors).forEach(function (key) {\n presetPalettes[key] = generate(presetPrimaryColors[key]);\n presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes\n\n presetDarkPalettes[key] = generate(presetPrimaryColors[key], {\n theme: 'dark',\n backgroundColor: '#141414'\n });\n presetDarkPalettes[key].primary = presetDarkPalettes[key][5];\n});\nvar red = presetPalettes.red;\nvar volcano = presetPalettes.volcano;\nvar gold = presetPalettes.gold;\nvar orange = presetPalettes.orange;\nvar yellow = presetPalettes.yellow;\nvar lime = presetPalettes.lime;\nvar green = presetPalettes.green;\nvar cyan = presetPalettes.cyan;\nvar blue = presetPalettes.blue;\nvar geekblue = presetPalettes.geekblue;\nvar purple = presetPalettes.purple;\nvar magenta = presetPalettes.magenta;\nvar grey = presetPalettes.grey;\n\nexport { blue, cyan, geekblue, generate, gold, green, grey, lime, magenta, orange, presetDarkPalettes, presetPalettes, presetPrimaryColors, purple, red, volcano, yellow };\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport { generate as generateColor } from '@ant-design/colors';\nimport React, { useContext, useEffect } from 'react';\nimport warn from \"rc-util/es/warning\";\nimport { updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport IconContext from './components/Context';\nexport function warning(valid, message) {\n warn(valid, \"[@ant-design/icons] \".concat(message));\n}\nexport function isIconDefinition(target) {\n return _typeof(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (_typeof(target.icon) === 'object' || typeof target.icon === 'function');\n}\nexport function normalizeAttrs() {\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return Object.keys(attrs).reduce(function (acc, key) {\n var val = attrs[key];\n switch (key) {\n case 'class':\n acc.className = val;\n delete acc.class;\n break;\n default:\n acc[key] = val;\n }\n return acc;\n }, {});\n}\nexport function generate(node, key, rootProps) {\n if (!rootProps) {\n return /*#__PURE__*/React.createElement(node.tag, _objectSpread({\n key: key\n }, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n }\n return /*#__PURE__*/React.createElement(node.tag, _objectSpread(_objectSpread({\n key: key\n }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n}\nexport function getSecondaryColor(primaryColor) {\n // choose the second color\n return generateColor(primaryColor)[0];\n}\nexport function normalizeTwoToneColors(twoToneColor) {\n if (!twoToneColor) {\n return [];\n }\n return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];\n}\n// These props make sure that the SVG behaviours like general text.\n// Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4\nexport var svgBaseProps = {\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true',\n focusable: 'false'\n};\nexport var iconStyles = \"\\n.anticon {\\n display: inline-block;\\n color: inherit;\\n font-style: normal;\\n line-height: 0;\\n text-align: center;\\n text-transform: none;\\n vertical-align: -0.125em;\\n text-rendering: optimizeLegibility;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n}\\n\\n.anticon > * {\\n line-height: 1;\\n}\\n\\n.anticon svg {\\n display: inline-block;\\n}\\n\\n.anticon::before {\\n display: none;\\n}\\n\\n.anticon .anticon-icon {\\n display: block;\\n}\\n\\n.anticon[tabindex] {\\n cursor: pointer;\\n}\\n\\n.anticon-spin::before,\\n.anticon-spin {\\n display: inline-block;\\n -webkit-animation: loadingCircle 1s infinite linear;\\n animation: loadingCircle 1s infinite linear;\\n}\\n\\n@-webkit-keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\";\nexport var useInsertStyles = function useInsertStyles() {\n var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;\n var _useContext = useContext(IconContext),\n csp = _useContext.csp;\n useEffect(function () {\n updateCSS(styleStr, '@ant-design-icons', {\n prepend: true,\n csp: csp\n });\n }, []);\n};","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nvar _excluded = [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"];\nimport { generate, getSecondaryColor, isIconDefinition, warning, useInsertStyles } from '../utils';\nvar twoToneColorPalette = {\n primaryColor: '#333',\n secondaryColor: '#E6E6E6',\n calculated: false\n};\nfunction setTwoToneColors(_ref) {\n var primaryColor = _ref.primaryColor,\n secondaryColor = _ref.secondaryColor;\n twoToneColorPalette.primaryColor = primaryColor;\n twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\nfunction getTwoToneColors() {\n return _objectSpread({}, twoToneColorPalette);\n}\nvar IconBase = function IconBase(props) {\n var icon = props.icon,\n className = props.className,\n onClick = props.onClick,\n style = props.style,\n primaryColor = props.primaryColor,\n secondaryColor = props.secondaryColor,\n restProps = _objectWithoutProperties(props, _excluded);\n var colors = twoToneColorPalette;\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || getSecondaryColor(primaryColor)\n };\n }\n useInsertStyles();\n warning(isIconDefinition(icon), \"icon should be icon definiton, but got \".concat(icon));\n if (!isIconDefinition(icon)) {\n return null;\n }\n var target = icon;\n if (target && typeof target.icon === 'function') {\n target = _objectSpread(_objectSpread({}, target), {}, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n return generate(target.icon, \"svg-\".concat(target.name), _objectSpread({\n className: className,\n onClick: onClick,\n style: style,\n 'data-icon': target.name,\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true'\n }, restProps));\n};\nIconBase.displayName = 'IconReact';\nIconBase.getTwoToneColors = getTwoToneColors;\nIconBase.setTwoToneColors = setTwoToneColors;\nexport default IconBase;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport ReactIcon from './IconBase';\nimport { normalizeTwoToneColors } from '../utils';\nexport function setTwoToneColor(twoToneColor) {\n var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),\n _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return ReactIcon.setTwoToneColors({\n primaryColor: primaryColor,\n secondaryColor: secondaryColor\n });\n}\nexport function getTwoToneColor() {\n var colors = ReactIcon.getTwoToneColors();\n if (!colors.calculated) {\n return colors.primaryColor;\n }\n return [colors.primaryColor, colors.secondaryColor];\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"className\", \"icon\", \"spin\", \"rotate\", \"tabIndex\", \"onClick\", \"twoToneColor\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Context from './Context';\nimport ReactIcon from './IconBase';\nimport { getTwoToneColor, setTwoToneColor } from './twoTonePrimaryColor';\nimport { normalizeTwoToneColors } from '../utils';\n// Initial setting\n// should move it to antd main repo?\nsetTwoToneColor('#1890ff');\nvar Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _classNames;\n var className = props.className,\n icon = props.icon,\n spin = props.spin,\n rotate = props.rotate,\n tabIndex = props.tabIndex,\n onClick = props.onClick,\n twoToneColor = props.twoToneColor,\n restProps = _objectWithoutProperties(props, _excluded);\n var _React$useContext = React.useContext(Context),\n _React$useContext$pre = _React$useContext.prefixCls,\n prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,\n rootClassName = _React$useContext.rootClassName;\n var classString = classNames(rootClassName, prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(icon.name), !!icon.name), _defineProperty(_classNames, \"\".concat(prefixCls, \"-spin\"), !!spin || icon.name === 'loading'), _classNames), className);\n var iconTabIndex = tabIndex;\n if (iconTabIndex === undefined && onClick) {\n iconTabIndex = -1;\n }\n var svgStyle = rotate ? {\n msTransform: \"rotate(\".concat(rotate, \"deg)\"),\n transform: \"rotate(\".concat(rotate, \"deg)\")\n } : undefined;\n var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),\n _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return /*#__PURE__*/React.createElement(\"span\", _objectSpread(_objectSpread({\n role: \"img\",\n \"aria-label\": icon.name\n }, restProps), {}, {\n ref: ref,\n tabIndex: iconTabIndex,\n onClick: onClick,\n className: classString\n }), /*#__PURE__*/React.createElement(ReactIcon, {\n icon: icon,\n primaryColor: primaryColor,\n secondaryColor: secondaryColor,\n style: svgStyle\n }));\n});\nIcon.displayName = 'AntdIcon';\nIcon.getTwoToneColor = getTwoToneColor;\nIcon.setTwoToneColor = setTwoToneColor;\nexport default Icon;","// This icon file is generated automatically.\nvar BarChartOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z\" } }] }, \"name\": \"bar-chart\", \"theme\": \"outlined\" };\nexport default BarChartOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport BarChartOutlinedSvg from \"@ant-design/icons-svg/es/asn/BarChartOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar BarChartOutlined = function BarChartOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: BarChartOutlinedSvg\n }));\n};\nBarChartOutlined.displayName = 'BarChartOutlined';\nexport default /*#__PURE__*/React.forwardRef(BarChartOutlined);","// This icon file is generated automatically.\nvar CheckCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z\" } }] }, \"name\": \"check-circle\", \"theme\": \"filled\" };\nexport default CheckCircleFilled;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CheckCircleFilledSvg from \"@ant-design/icons-svg/es/asn/CheckCircleFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar CheckCircleFilled = function CheckCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CheckCircleFilledSvg\n }));\n};\nCheckCircleFilled.displayName = 'CheckCircleFilled';\nexport default /*#__PURE__*/React.forwardRef(CheckCircleFilled);","// This icon file is generated automatically.\nvar CheckCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }] }, \"name\": \"check-circle\", \"theme\": \"outlined\" };\nexport default CheckCircleOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CheckCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/CheckCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CheckCircleOutlined = function CheckCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CheckCircleOutlinedSvg\n }));\n};\nCheckCircleOutlined.displayName = 'CheckCircleOutlined';\nexport default /*#__PURE__*/React.forwardRef(CheckCircleOutlined);","// This icon file is generated automatically.\nvar CheckOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z\" } }] }, \"name\": \"check\", \"theme\": \"outlined\" };\nexport default CheckOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CheckOutlinedSvg from \"@ant-design/icons-svg/es/asn/CheckOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CheckOutlined = function CheckOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CheckOutlinedSvg\n }));\n};\nCheckOutlined.displayName = 'CheckOutlined';\nexport default /*#__PURE__*/React.forwardRef(CheckOutlined);","// This icon file is generated automatically.\nvar CloseCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z\" } }] }, \"name\": \"close-circle\", \"theme\": \"filled\" };\nexport default CloseCircleFilled;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CloseCircleFilledSvg from \"@ant-design/icons-svg/es/asn/CloseCircleFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloseCircleFilled = function CloseCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloseCircleFilledSvg\n }));\n};\nCloseCircleFilled.displayName = 'CloseCircleFilled';\nexport default /*#__PURE__*/React.forwardRef(CloseCircleFilled);","// This icon file is generated automatically.\nvar CloseCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }] }, \"name\": \"close-circle\", \"theme\": \"outlined\" };\nexport default CloseCircleOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CloseCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/CloseCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloseCircleOutlined = function CloseCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloseCircleOutlinedSvg\n }));\n};\nCloseCircleOutlined.displayName = 'CloseCircleOutlined';\nexport default /*#__PURE__*/React.forwardRef(CloseCircleOutlined);","// This icon file is generated automatically.\nvar CloseOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z\" } }] }, \"name\": \"close\", \"theme\": \"outlined\" };\nexport default CloseOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CloseOutlinedSvg from \"@ant-design/icons-svg/es/asn/CloseOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloseOutlined = function CloseOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloseOutlinedSvg\n }));\n};\nCloseOutlined.displayName = 'CloseOutlined';\nexport default /*#__PURE__*/React.forwardRef(CloseOutlined);","// This icon file is generated automatically.\nvar DollarOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z\" } }] }, \"name\": \"dollar\", \"theme\": \"outlined\" };\nexport default DollarOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport DollarOutlinedSvg from \"@ant-design/icons-svg/es/asn/DollarOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DollarOutlined = function DollarOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DollarOutlinedSvg\n }));\n};\nDollarOutlined.displayName = 'DollarOutlined';\nexport default /*#__PURE__*/React.forwardRef(DollarOutlined);","// This icon file is generated automatically.\nvar DownOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\" } }] }, \"name\": \"down\", \"theme\": \"outlined\" };\nexport default DownOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport DownOutlinedSvg from \"@ant-design/icons-svg/es/asn/DownOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DownOutlined = function DownOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DownOutlinedSvg\n }));\n};\nDownOutlined.displayName = 'DownOutlined';\nexport default /*#__PURE__*/React.forwardRef(DownOutlined);","// This icon file is generated automatically.\nvar InfoCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"info-circle\", \"theme\": \"outlined\" };\nexport default InfoCircleOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport InfoCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/InfoCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar InfoCircleOutlined = function InfoCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: InfoCircleOutlinedSvg\n }));\n};\nInfoCircleOutlined.displayName = 'InfoCircleOutlined';\nexport default /*#__PURE__*/React.forwardRef(InfoCircleOutlined);","// This icon file is generated automatically.\nvar LeftOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z\" } }] }, \"name\": \"left\", \"theme\": \"outlined\" };\nexport default LeftOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport LeftOutlinedSvg from \"@ant-design/icons-svg/es/asn/LeftOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar LeftOutlined = function LeftOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: LeftOutlinedSvg\n }));\n};\nLeftOutlined.displayName = 'LeftOutlined';\nexport default /*#__PURE__*/React.forwardRef(LeftOutlined);","// This icon file is generated automatically.\nvar LoadingOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z\" } }] }, \"name\": \"loading\", \"theme\": \"outlined\" };\nexport default LoadingOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport LoadingOutlinedSvg from \"@ant-design/icons-svg/es/asn/LoadingOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar LoadingOutlined = function LoadingOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: LoadingOutlinedSvg\n }));\n};\nLoadingOutlined.displayName = 'LoadingOutlined';\nexport default /*#__PURE__*/React.forwardRef(LoadingOutlined);","// This icon file is generated automatically.\nvar LogoutOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z\" } }] }, \"name\": \"logout\", \"theme\": \"outlined\" };\nexport default LogoutOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport LogoutOutlinedSvg from \"@ant-design/icons-svg/es/asn/LogoutOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar LogoutOutlined = function LogoutOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: LogoutOutlinedSvg\n }));\n};\nLogoutOutlined.displayName = 'LogoutOutlined';\nexport default /*#__PURE__*/React.forwardRef(LogoutOutlined);","// This icon file is generated automatically.\nvar MailOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z\" } }] }, \"name\": \"mail\", \"theme\": \"outlined\" };\nexport default MailOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport MailOutlinedSvg from \"@ant-design/icons-svg/es/asn/MailOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar MailOutlined = function MailOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MailOutlinedSvg\n }));\n};\nMailOutlined.displayName = 'MailOutlined';\nexport default /*#__PURE__*/React.forwardRef(MailOutlined);","// This icon file is generated automatically.\nvar MenuOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"menu\", \"theme\": \"outlined\" };\nexport default MenuOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport MenuOutlinedSvg from \"@ant-design/icons-svg/es/asn/MenuOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar MenuOutlined = function MenuOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MenuOutlinedSvg\n }));\n};\nMenuOutlined.displayName = 'MenuOutlined';\nexport default /*#__PURE__*/React.forwardRef(MenuOutlined);","// This icon file is generated automatically.\nvar ReloadOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z\" } }] }, \"name\": \"reload\", \"theme\": \"outlined\" };\nexport default ReloadOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport ReloadOutlinedSvg from \"@ant-design/icons-svg/es/asn/ReloadOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ReloadOutlined = function ReloadOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ReloadOutlinedSvg\n }));\n};\nReloadOutlined.displayName = 'ReloadOutlined';\nexport default /*#__PURE__*/React.forwardRef(ReloadOutlined);","// This icon file is generated automatically.\nvar RightOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\" } }] }, \"name\": \"right\", \"theme\": \"outlined\" };\nexport default RightOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport RightOutlinedSvg from \"@ant-design/icons-svg/es/asn/RightOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RightOutlined = function RightOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RightOutlinedSvg\n }));\n};\nRightOutlined.displayName = 'RightOutlined';\nexport default /*#__PURE__*/React.forwardRef(RightOutlined);","// This icon file is generated automatically.\nvar RocketOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z\" } }] }, \"name\": \"rocket\", \"theme\": \"outlined\" };\nexport default RocketOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport RocketOutlinedSvg from \"@ant-design/icons-svg/es/asn/RocketOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RocketOutlined = function RocketOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RocketOutlinedSvg\n }));\n};\nRocketOutlined.displayName = 'RocketOutlined';\nexport default /*#__PURE__*/React.forwardRef(RocketOutlined);","// This icon file is generated automatically.\nvar SearchOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z\" } }] }, \"name\": \"search\", \"theme\": \"outlined\" };\nexport default SearchOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport SearchOutlinedSvg from \"@ant-design/icons-svg/es/asn/SearchOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SearchOutlined = function SearchOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SearchOutlinedSvg\n }));\n};\nSearchOutlined.displayName = 'SearchOutlined';\nexport default /*#__PURE__*/React.forwardRef(SearchOutlined);","// This icon file is generated automatically.\nvar SettingOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z\" } }] }, \"name\": \"setting\", \"theme\": \"outlined\" };\nexport default SettingOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport SettingOutlinedSvg from \"@ant-design/icons-svg/es/asn/SettingOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SettingOutlined = function SettingOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SettingOutlinedSvg\n }));\n};\nSettingOutlined.displayName = 'SettingOutlined';\nexport default /*#__PURE__*/React.forwardRef(SettingOutlined);","// This icon file is generated automatically.\nvar UserOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z\" } }] }, \"name\": \"user\", \"theme\": \"outlined\" };\nexport default UserOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport UserOutlinedSvg from \"@ant-design/icons-svg/es/asn/UserOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar UserOutlined = function UserOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: UserOutlinedSvg\n }));\n};\nUserOutlined.displayName = 'UserOutlined';\nexport default /*#__PURE__*/React.forwardRef(UserOutlined);","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"className\", \"component\", \"viewBox\", \"spin\", \"rotate\", \"tabIndex\", \"onClick\", \"children\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Context from './Context';\nimport { svgBaseProps, warning, useInsertStyles } from '../utils';\nvar Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var className = props.className,\n Component = props.component,\n viewBox = props.viewBox,\n spin = props.spin,\n rotate = props.rotate,\n tabIndex = props.tabIndex,\n onClick = props.onClick,\n children = props.children,\n restProps = _objectWithoutProperties(props, _excluded);\n warning(Boolean(Component || children), 'Should have `component` prop or `children`.');\n useInsertStyles();\n var _React$useContext = React.useContext(Context),\n _React$useContext$pre = _React$useContext.prefixCls,\n prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,\n rootClassName = _React$useContext.rootClassName;\n var classString = classNames(rootClassName, prefixCls, className);\n var svgClassString = classNames(_defineProperty({}, \"\".concat(prefixCls, \"-spin\"), !!spin));\n var svgStyle = rotate ? {\n msTransform: \"rotate(\".concat(rotate, \"deg)\"),\n transform: \"rotate(\".concat(rotate, \"deg)\")\n } : undefined;\n var innerSvgProps = _objectSpread(_objectSpread({}, svgBaseProps), {}, {\n className: svgClassString,\n style: svgStyle,\n viewBox: viewBox\n });\n if (!viewBox) {\n delete innerSvgProps.viewBox;\n }\n // component > children\n var renderInnerNode = function renderInnerNode() {\n if (Component) {\n return /*#__PURE__*/React.createElement(Component, _objectSpread({}, innerSvgProps), children);\n }\n if (children) {\n warning(Boolean(viewBox) || React.Children.count(children) === 1 && /*#__PURE__*/React.isValidElement(children) && React.Children.only(children).type === 'use', 'Make sure that you provide correct `viewBox`' + ' prop (default `0 0 1024 1024`) to the icon.');\n return /*#__PURE__*/React.createElement(\"svg\", _objectSpread(_objectSpread({}, innerSvgProps), {}, {\n viewBox: viewBox\n }), children);\n }\n return null;\n };\n var iconTabIndex = tabIndex;\n if (iconTabIndex === undefined && onClick) {\n iconTabIndex = -1;\n }\n return /*#__PURE__*/React.createElement(\"span\", _objectSpread(_objectSpread({\n role: \"img\"\n }, restProps), {}, {\n ref: ref,\n tabIndex: iconTabIndex,\n onClick: onClick,\n className: classString\n }), renderInnerNode());\n});\nIcon.displayName = 'AntdIcon';\nexport default Icon;","export const colorPrimary = '#2A85FF'\nexport const colorTextTertiary = '#959da1'\nexport const colorTextSecondary = '#6C7278'\nexport const colorCardSecondary = '#B1E5FC40'\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __extends } from \"tslib\";\nvar genericMessage = \"Invariant Violation\";\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\n obj.__proto__ = proto;\n return obj;\n} : _a;\nvar InvariantError = /** @class */ (function (_super) {\n __extends(InvariantError, _super);\n function InvariantError(message) {\n if (message === void 0) { message = genericMessage; }\n var _this = _super.call(this, typeof message === \"number\"\n ? genericMessage + \": \" + message + \" (see https://github.com/apollographql/invariant-packages)\"\n : message) || this;\n _this.framesToPop = 1;\n _this.name = genericMessage;\n setPrototypeOf(_this, InvariantError.prototype);\n return _this;\n }\n return InvariantError;\n}(Error));\nexport { InvariantError };\nexport function invariant(condition, message) {\n if (!condition) {\n throw new InvariantError(message);\n }\n}\nvar verbosityLevels = [\"debug\", \"log\", \"warn\", \"error\", \"silent\"];\nvar verbosityLevel = verbosityLevels.indexOf(\"log\");\nfunction wrapConsoleMethod(name) {\n return function () {\n if (verbosityLevels.indexOf(name) >= verbosityLevel) {\n // Default to console.log if this host environment happens not to provide\n // all the console.* methods we need.\n var method = console[name] || console.log;\n return method.apply(console, arguments);\n }\n };\n}\n(function (invariant) {\n invariant.debug = wrapConsoleMethod(\"debug\");\n invariant.log = wrapConsoleMethod(\"log\");\n invariant.warn = wrapConsoleMethod(\"warn\");\n invariant.error = wrapConsoleMethod(\"error\");\n})(invariant || (invariant = {}));\nexport function setVerbosity(level) {\n var old = verbosityLevels[verbosityLevel];\n verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\n return old;\n}\nexport default invariant;\n//# sourceMappingURL=invariant.js.map","export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe.js\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) || maybe(function () { return maybe.constructor(\"return this\")(); }));\n//# sourceMappingURL=global.js.map","import global from \"./global.js\";\nimport { maybe } from \"./maybe.js\";\nvar __ = \"__\";\nvar GLOBAL_KEY = [__, __].join(\"DEV\");\nfunction getDEV() {\n try {\n return Boolean(__DEV__);\n }\n catch (_a) {\n Object.defineProperty(global, GLOBAL_KEY, {\n value: maybe(function () { return process.env.NODE_ENV; }) !== \"production\",\n enumerable: false,\n configurable: true,\n writable: true,\n });\n return global[GLOBAL_KEY];\n }\n}\nexport default getDEV();\n//# sourceMappingURL=DEV.js.map","function maybe(thunk) {\n try { return thunk() } catch (_) {}\n}\n\nvar safeGlobal = (\n maybe(function() { return globalThis }) ||\n maybe(function() { return window }) ||\n maybe(function() { return self }) ||\n maybe(function() { return global }) ||\n // We don't expect the Function constructor ever to be invoked at runtime, as\n // long as at least one of globalThis, window, self, or global is defined, so\n // we are under no obligation to make it easy for static analysis tools to\n // detect syntactic usage of the Function constructor. If you think you can\n // improve your static analysis to detect this obfuscation, think again. This\n // is an arms race you cannot win, at least not in JavaScript.\n maybe(function() { return maybe.constructor(\"return this\")() })\n);\n\nvar needToRemove = false;\n\nexport function install() {\n if (safeGlobal &&\n !maybe(function() { return process.env.NODE_ENV }) &&\n !maybe(function() { return process })) {\n Object.defineProperty(safeGlobal, \"process\", {\n value: {\n env: {\n // This default needs to be \"production\" instead of \"development\", to\n // avoid the problem https://github.com/graphql/graphql-js/pull/2894\n // will eventually solve, once merged and released.\n NODE_ENV: \"production\",\n },\n },\n // Let anyone else change global.process as they see fit, but hide it from\n // Object.keys(global) enumeration.\n configurable: true,\n enumerable: false,\n writable: true,\n });\n needToRemove = true;\n }\n}\n\n// Call install() at least once, when this module is imported.\ninstall();\n\nexport function remove() {\n if (needToRemove) {\n delete safeGlobal.process;\n needToRemove = false;\n }\n}\n","export function devAssert(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport function isObjectLike(value) {\n return typeof value == 'object' && value !== null;\n}\n","export function invariant(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(\n message != null ? message : 'Unexpected invariant triggered.',\n );\n }\n}\n","import { invariant } from '../jsutils/invariant.mjs';\nconst LineRegExp = /\\r\\n|[\\n\\r]/g;\n/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}\n","import { getLocation } from './location.mjs';\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\nexport function printLocation(location) {\n return printSourceLocation(\n location.source,\n getLocation(location.source, location.start),\n );\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n const firstLineColumnOffset = source.locationOffset.column - 1;\n const body = ''.padStart(firstLineColumnOffset) + source.body;\n const lineIndex = sourceLocation.line - 1;\n const lineOffset = source.locationOffset.line - 1;\n const lineNum = sourceLocation.line + lineOffset;\n const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n const columnNum = sourceLocation.column + columnOffset;\n const locationStr = `${source.name}:${lineNum}:${columnNum}\\n`;\n const lines = body.split(/\\r\\n|[\\n\\r]/g);\n const locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n const subLineIndex = Math.floor(columnNum / 80);\n const subLineColumnNum = columnNum % 80;\n const subLines = [];\n\n for (let i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return (\n locationStr +\n printPrefixedLines([\n [`${lineNum} |`, subLines[0]],\n ...subLines.slice(1, subLineIndex + 1).map((subLine) => ['|', subLine]),\n ['|', '^'.padStart(subLineColumnNum)],\n ['|', subLines[subLineIndex + 1]],\n ])\n );\n }\n\n return (\n locationStr +\n printPrefixedLines([\n // Lines specified like this: [\"prefix\", \"string\"],\n [`${lineNum - 1} |`, lines[lineIndex - 1]],\n [`${lineNum} |`, locationLine],\n ['|', '^'.padStart(columnNum)],\n [`${lineNum + 1} |`, lines[lineIndex + 1]],\n ])\n );\n}\n\nfunction printPrefixedLines(lines) {\n const existingLines = lines.filter(([_, line]) => line !== undefined);\n const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));\n return existingLines\n .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : ''))\n .join('\\n');\n}\n","import { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { getLocation } from '../language/location.mjs';\nimport {\n printLocation,\n printSourceLocation,\n} from '../language/printLocation.mjs';\n\nfunction toNormalizedOptions(args) {\n const firstArg = args[0];\n\n if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {\n return {\n nodes: firstArg,\n source: args[1],\n positions: args[2],\n path: args[3],\n originalError: args[4],\n extensions: args[5],\n };\n }\n\n return firstArg;\n}\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport class GraphQLError extends Error {\n /**\n * An array of `{ line, column }` locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n\n /**\n * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.\n */\n constructor(message, ...rawArgs) {\n var _this$nodes, _nodeLocations$, _ref;\n\n const { nodes, source, positions, path, originalError, extensions } =\n toNormalizedOptions(rawArgs);\n super(message);\n this.name = 'GraphQLError';\n this.path = path !== null && path !== void 0 ? path : undefined;\n this.originalError =\n originalError !== null && originalError !== void 0\n ? originalError\n : undefined; // Compute list of blame nodes.\n\n this.nodes = undefinedIfEmpty(\n Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,\n );\n const nodeLocations = undefinedIfEmpty(\n (_this$nodes = this.nodes) === null || _this$nodes === void 0\n ? void 0\n : _this$nodes.map((node) => node.loc).filter((loc) => loc != null),\n ); // Compute locations in the source for the given nodes/positions.\n\n this.source =\n source !== null && source !== void 0\n ? source\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : (_nodeLocations$ = nodeLocations[0]) === null ||\n _nodeLocations$ === void 0\n ? void 0\n : _nodeLocations$.source;\n this.positions =\n positions !== null && positions !== void 0\n ? positions\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => loc.start);\n this.locations =\n positions && source\n ? positions.map((pos) => getLocation(source, pos))\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => getLocation(loc.source, loc.start));\n const originalExtensions = isObjectLike(\n originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions,\n )\n ? originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions\n : undefined;\n this.extensions =\n (_ref =\n extensions !== null && extensions !== void 0\n ? extensions\n : originalExtensions) !== null && _ref !== void 0\n ? _ref\n : Object.create(null); // Only properties prescribed by the spec should be enumerable.\n // Keep the rest as non-enumerable.\n\n Object.defineProperties(this, {\n message: {\n writable: true,\n enumerable: true,\n },\n name: {\n enumerable: false,\n },\n nodes: {\n enumerable: false,\n },\n source: {\n enumerable: false,\n },\n positions: {\n enumerable: false,\n },\n originalError: {\n enumerable: false,\n },\n }); // Include (non-enumerable) stack trace.\n\n /* c8 ignore start */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n\n if (\n originalError !== null &&\n originalError !== void 0 &&\n originalError.stack\n ) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true,\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true,\n });\n }\n /* c8 ignore stop */\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLError';\n }\n\n toString() {\n let output = this.message;\n\n if (this.nodes) {\n for (const node of this.nodes) {\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (this.source && this.locations) {\n for (const location of this.locations) {\n output += '\\n\\n' + printSourceLocation(this.source, location);\n }\n }\n\n return output;\n }\n\n toJSON() {\n const formattedError = {\n message: this.message,\n };\n\n if (this.locations != null) {\n formattedError.locations = this.locations;\n }\n\n if (this.path != null) {\n formattedError.path = this.path;\n }\n\n if (this.extensions != null && Object.keys(this.extensions).length > 0) {\n formattedError.extensions = this.extensions;\n }\n\n return formattedError;\n }\n}\n\nfunction undefinedIfEmpty(array) {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n/**\n * See: https://spec.graphql.org/draft/#sec-Errors\n */\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n *\n * @deprecated Please use `error.toString` instead. Will be removed in v17\n */\nexport function printError(error) {\n return error.toString();\n}\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n *\n * @deprecated Please use `error.toJSON` instead. Will be removed in v17\n */\n\nexport function formatError(error) {\n return error.toJSON();\n}\n","import { GraphQLError } from './GraphQLError.mjs';\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(`Syntax Error: ${description}`, {\n source,\n positions: [position],\n });\n}\n","/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport class Location {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n constructor(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n get [Symbol.toStringTag]() {\n return 'Location';\n }\n\n toJSON() {\n return {\n start: this.start,\n end: this.end,\n };\n }\n}\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport class Token {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n *\n * Note: is undefined for punctuation tokens, but typed as string for\n * convenience in the parser.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n constructor(kind, start, end, line, column, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\n this.value = value;\n this.prev = null;\n this.next = null;\n }\n\n get [Symbol.toStringTag]() {\n return 'Token';\n }\n\n toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column,\n };\n }\n}\n/**\n * The list of all possible AST node types.\n */\n\n/**\n * @internal\n */\nexport const QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: [\n 'name',\n 'variableDefinitions',\n 'directives',\n 'selectionSet',\n ],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: [\n 'name', // Note: fragment variable definitions are deprecated and will removed in v17.0.0\n 'variableDefinitions',\n 'typeCondition',\n 'directives',\n 'selectionSet',\n ],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: [\n 'description',\n 'name',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n InterfaceTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n};\nconst kindValues = new Set(Object.keys(QueryDocumentKeys));\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n const maybeKind =\n maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;\n return typeof maybeKind === 'string' && kindValues.has(maybeKind);\n}\n/** Name */\n\nvar OperationTypeNode;\n\n(function (OperationTypeNode) {\n OperationTypeNode['QUERY'] = 'query';\n OperationTypeNode['MUTATION'] = 'mutation';\n OperationTypeNode['SUBSCRIPTION'] = 'subscription';\n})(OperationTypeNode || (OperationTypeNode = {}));\n\nexport { OperationTypeNode };\n","/**\n * The set of allowed directive location values.\n */\nvar DirectiveLocation;\n\n(function (DirectiveLocation) {\n DirectiveLocation['QUERY'] = 'QUERY';\n DirectiveLocation['MUTATION'] = 'MUTATION';\n DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION';\n DirectiveLocation['FIELD'] = 'FIELD';\n DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION';\n DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD';\n DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT';\n DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION';\n DirectiveLocation['SCHEMA'] = 'SCHEMA';\n DirectiveLocation['SCALAR'] = 'SCALAR';\n DirectiveLocation['OBJECT'] = 'OBJECT';\n DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION';\n DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION';\n DirectiveLocation['INTERFACE'] = 'INTERFACE';\n DirectiveLocation['UNION'] = 'UNION';\n DirectiveLocation['ENUM'] = 'ENUM';\n DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE';\n DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';\n DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';\n})(DirectiveLocation || (DirectiveLocation = {}));\n\nexport { DirectiveLocation };\n/**\n * The enum type representing the directive location values.\n *\n * @deprecated Please use `DirectiveLocation`. Will be remove in v17.\n */\n","/**\n * The set of allowed kind values for AST nodes.\n */\nvar Kind;\n\n(function (Kind) {\n Kind['NAME'] = 'Name';\n Kind['DOCUMENT'] = 'Document';\n Kind['OPERATION_DEFINITION'] = 'OperationDefinition';\n Kind['VARIABLE_DEFINITION'] = 'VariableDefinition';\n Kind['SELECTION_SET'] = 'SelectionSet';\n Kind['FIELD'] = 'Field';\n Kind['ARGUMENT'] = 'Argument';\n Kind['FRAGMENT_SPREAD'] = 'FragmentSpread';\n Kind['INLINE_FRAGMENT'] = 'InlineFragment';\n Kind['FRAGMENT_DEFINITION'] = 'FragmentDefinition';\n Kind['VARIABLE'] = 'Variable';\n Kind['INT'] = 'IntValue';\n Kind['FLOAT'] = 'FloatValue';\n Kind['STRING'] = 'StringValue';\n Kind['BOOLEAN'] = 'BooleanValue';\n Kind['NULL'] = 'NullValue';\n Kind['ENUM'] = 'EnumValue';\n Kind['LIST'] = 'ListValue';\n Kind['OBJECT'] = 'ObjectValue';\n Kind['OBJECT_FIELD'] = 'ObjectField';\n Kind['DIRECTIVE'] = 'Directive';\n Kind['NAMED_TYPE'] = 'NamedType';\n Kind['LIST_TYPE'] = 'ListType';\n Kind['NON_NULL_TYPE'] = 'NonNullType';\n Kind['SCHEMA_DEFINITION'] = 'SchemaDefinition';\n Kind['OPERATION_TYPE_DEFINITION'] = 'OperationTypeDefinition';\n Kind['SCALAR_TYPE_DEFINITION'] = 'ScalarTypeDefinition';\n Kind['OBJECT_TYPE_DEFINITION'] = 'ObjectTypeDefinition';\n Kind['FIELD_DEFINITION'] = 'FieldDefinition';\n Kind['INPUT_VALUE_DEFINITION'] = 'InputValueDefinition';\n Kind['INTERFACE_TYPE_DEFINITION'] = 'InterfaceTypeDefinition';\n Kind['UNION_TYPE_DEFINITION'] = 'UnionTypeDefinition';\n Kind['ENUM_TYPE_DEFINITION'] = 'EnumTypeDefinition';\n Kind['ENUM_VALUE_DEFINITION'] = 'EnumValueDefinition';\n Kind['INPUT_OBJECT_TYPE_DEFINITION'] = 'InputObjectTypeDefinition';\n Kind['DIRECTIVE_DEFINITION'] = 'DirectiveDefinition';\n Kind['SCHEMA_EXTENSION'] = 'SchemaExtension';\n Kind['SCALAR_TYPE_EXTENSION'] = 'ScalarTypeExtension';\n Kind['OBJECT_TYPE_EXTENSION'] = 'ObjectTypeExtension';\n Kind['INTERFACE_TYPE_EXTENSION'] = 'InterfaceTypeExtension';\n Kind['UNION_TYPE_EXTENSION'] = 'UnionTypeExtension';\n Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';\n Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';\n})(Kind || (Kind = {}));\n\nexport { Kind };\n/**\n * The enum type representing the possible kind values of AST nodes.\n *\n * @deprecated Please use `Kind`. Will be remove in v17.\n */\n","/**\n * ```\n * WhiteSpace ::\n * - \"Horizontal Tab (U+0009)\"\n * - \"Space (U+0020)\"\n * ```\n * @internal\n */\nexport function isWhiteSpace(code) {\n return code === 0x0009 || code === 0x0020;\n}\n/**\n * ```\n * Digit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * ```\n * @internal\n */\n\nexport function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}\n/**\n * ```\n * Letter :: one of\n * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`\n * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`\n * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`\n * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`\n * ```\n * @internal\n */\n\nexport function isLetter(code) {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}\n/**\n * ```\n * NameStart ::\n * - Letter\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}\n/**\n * ```\n * NameContinue ::\n * - Letter\n * - Digit\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameContinue(code) {\n return isLetter(code) || isDigit(code) || code === 0x005f;\n}\n","import { isWhiteSpace } from './characterClasses.mjs';\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\n\nexport function dedentBlockStringLines(lines) {\n var _firstNonEmptyLine2;\n\n let commonIndent = Number.MAX_SAFE_INTEGER;\n let firstNonEmptyLine = null;\n let lastNonEmptyLine = -1;\n\n for (let i = 0; i < lines.length; ++i) {\n var _firstNonEmptyLine;\n\n const line = lines[i];\n const indent = leadingWhitespace(line);\n\n if (indent === line.length) {\n continue; // skip empty lines\n }\n\n firstNonEmptyLine =\n (_firstNonEmptyLine = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine !== void 0\n ? _firstNonEmptyLine\n : i;\n lastNonEmptyLine = i;\n\n if (i !== 0 && indent < commonIndent) {\n commonIndent = indent;\n }\n }\n\n return lines // Remove common indentation from all lines but first.\n .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) // Remove leading and trailing blank lines.\n .slice(\n (_firstNonEmptyLine2 = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine2 !== void 0\n ? _firstNonEmptyLine2\n : 0,\n lastNonEmptyLine + 1,\n );\n}\n\nfunction leadingWhitespace(str) {\n let i = 0;\n\n while (i < str.length && isWhiteSpace(str.charCodeAt(i))) {\n ++i;\n }\n\n return i;\n}\n/**\n * @internal\n */\n\nexport function isPrintableAsBlockString(value) {\n if (value === '') {\n return true; // empty string is printable\n }\n\n let isEmptyLine = true;\n let hasIndent = false;\n let hasCommonIndent = true;\n let seenNonEmptyLine = false;\n\n for (let i = 0; i < value.length; ++i) {\n switch (value.codePointAt(i)) {\n case 0x0000:\n case 0x0001:\n case 0x0002:\n case 0x0003:\n case 0x0004:\n case 0x0005:\n case 0x0006:\n case 0x0007:\n case 0x0008:\n case 0x000b:\n case 0x000c:\n case 0x000e:\n case 0x000f:\n return false;\n // Has non-printable characters\n\n case 0x000d:\n // \\r\n return false;\n // Has \\r or \\r\\n which will be replaced as \\n\n\n case 10:\n // \\n\n if (isEmptyLine && !seenNonEmptyLine) {\n return false; // Has leading new line\n }\n\n seenNonEmptyLine = true;\n isEmptyLine = true;\n hasIndent = false;\n break;\n\n case 9: // \\t\n\n case 32:\n // \n hasIndent || (hasIndent = isEmptyLine);\n break;\n\n default:\n hasCommonIndent && (hasCommonIndent = hasIndent);\n isEmptyLine = false;\n }\n }\n\n if (isEmptyLine) {\n return false; // Has trailing empty lines\n }\n\n if (hasCommonIndent && seenNonEmptyLine) {\n return false; // Has internal indent\n }\n\n return true;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value, options) {\n const escapedValue = value.replace(/\"\"\"/g, '\\\\\"\"\"'); // Expand a block string's raw value into independent lines.\n\n const lines = escapedValue.split(/\\r\\n|[\\n\\r]/g);\n const isSingleLine = lines.length === 1; // If common indentation is found we can fix some of those cases by adding leading new line\n\n const forceLeadingNewLine =\n lines.length > 1 &&\n lines\n .slice(1)\n .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0))); // Trailing triple quotes just looks confusing but doesn't force trailing new line\n\n const hasTrailingTripleQuotes = escapedValue.endsWith('\\\\\"\"\"'); // Trailing quote (single or double) or slash forces trailing new line\n\n const hasTrailingQuote = value.endsWith('\"') && !hasTrailingTripleQuotes;\n const hasTrailingSlash = value.endsWith('\\\\');\n const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;\n const printAsMultipleLines =\n !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability\n (!isSingleLine ||\n value.length > 70 ||\n forceTrailingNewline ||\n forceLeadingNewLine ||\n hasTrailingTripleQuotes);\n let result = ''; // Format a multi-line block quote to account for leading space.\n\n const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));\n\n if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) {\n result += '\\n';\n }\n\n result += escapedValue;\n\n if (printAsMultipleLines || forceTrailingNewline) {\n result += '\\n';\n }\n\n return '\"\"\"' + result + '\"\"\"';\n}\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind;\n\n(function (TokenKind) {\n TokenKind['SOF'] = '';\n TokenKind['EOF'] = '';\n TokenKind['BANG'] = '!';\n TokenKind['DOLLAR'] = '$';\n TokenKind['AMP'] = '&';\n TokenKind['PAREN_L'] = '(';\n TokenKind['PAREN_R'] = ')';\n TokenKind['SPREAD'] = '...';\n TokenKind['COLON'] = ':';\n TokenKind['EQUALS'] = '=';\n TokenKind['AT'] = '@';\n TokenKind['BRACKET_L'] = '[';\n TokenKind['BRACKET_R'] = ']';\n TokenKind['BRACE_L'] = '{';\n TokenKind['PIPE'] = '|';\n TokenKind['BRACE_R'] = '}';\n TokenKind['NAME'] = 'Name';\n TokenKind['INT'] = 'Int';\n TokenKind['FLOAT'] = 'Float';\n TokenKind['STRING'] = 'String';\n TokenKind['BLOCK_STRING'] = 'BlockString';\n TokenKind['COMMENT'] = 'Comment';\n})(TokenKind || (TokenKind = {}));\n\nexport { TokenKind };\n/**\n * The enum type representing the token kinds values.\n *\n * @deprecated Please use `TokenKind`. Will be remove in v17.\n */\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Token } from './ast.mjs';\nimport { dedentBlockStringLines } from './blockString.mjs';\nimport { isDigit, isNameContinue, isNameStart } from './characterClasses.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport class Lexer {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n constructor(source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n\n get [Symbol.toStringTag]() {\n return 'Lexer';\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n advance() {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n\n lookahead() {\n let token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing.\n\n token.next = nextToken; // @ts-expect-error prev is only mutable during parsing.\n\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n }\n}\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return (\n kind === TokenKind.BANG ||\n kind === TokenKind.DOLLAR ||\n kind === TokenKind.AMP ||\n kind === TokenKind.PAREN_L ||\n kind === TokenKind.PAREN_R ||\n kind === TokenKind.SPREAD ||\n kind === TokenKind.COLON ||\n kind === TokenKind.EQUALS ||\n kind === TokenKind.AT ||\n kind === TokenKind.BRACKET_L ||\n kind === TokenKind.BRACKET_R ||\n kind === TokenKind.BRACE_L ||\n kind === TokenKind.PIPE ||\n kind === TokenKind.BRACE_R\n );\n}\n/**\n * A Unicode scalar value is any Unicode code point except surrogate code\n * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and\n * 0xE000 to 0x10FFFF.\n *\n * SourceCharacter ::\n * - \"Any Unicode scalar value\"\n */\n\nfunction isUnicodeScalarValue(code) {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}\n/**\n * The GraphQL specification defines source text as a sequence of unicode scalar\n * values (which Unicode defines to exclude surrogate code points). However\n * JavaScript defines strings as a sequence of UTF-16 code units which may\n * include surrogates. A surrogate pair is a valid source character as it\n * encodes a supplementary code point (above U+FFFF), but unpaired surrogate\n * code points are not valid source characters.\n */\n\nfunction isSupplementaryCodePoint(body, location) {\n return (\n isLeadingSurrogate(body.charCodeAt(location)) &&\n isTrailingSurrogate(body.charCodeAt(location + 1))\n );\n}\n\nfunction isLeadingSurrogate(code) {\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction isTrailingSurrogate(code) {\n return code >= 0xdc00 && code <= 0xdfff;\n}\n/**\n * Prints the code point (or end of file reference) at a given location in a\n * source for use in error messages.\n *\n * Printable ASCII is printed quoted, while other points are printed in Unicode\n * code point form (ie. U+1234).\n */\n\nfunction printCodePointAt(lexer, location) {\n const code = lexer.source.body.codePointAt(location);\n\n if (code === undefined) {\n return TokenKind.EOF;\n } else if (code >= 0x0020 && code <= 0x007e) {\n // Printable ASCII\n const char = String.fromCodePoint(code);\n return char === '\"' ? \"'\\\"'\" : `\"${char}\"`;\n } // Unicode code point\n\n return 'U+' + code.toString(16).toUpperCase().padStart(4, '0');\n}\n/**\n * Create a token with line and column location information.\n */\n\nfunction createToken(lexer, kind, start, end, value) {\n const line = lexer.line;\n const col = 1 + start - lexer.lineStart;\n return new Token(kind, start, end, line, col, value);\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\nfunction readNextToken(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // SourceCharacter\n\n switch (code) {\n // Ignored ::\n // - UnicodeBOM\n // - WhiteSpace\n // - LineTerminator\n // - Comment\n // - Comma\n //\n // UnicodeBOM :: \"Byte Order Mark (U+FEFF)\"\n //\n // WhiteSpace ::\n // - \"Horizontal Tab (U+0009)\"\n // - \"Space (U+0020)\"\n //\n // Comma :: ,\n case 0xfeff: // \n\n case 0x0009: // \\t\n\n case 0x0020: // \n\n case 0x002c:\n // ,\n ++position;\n continue;\n // LineTerminator ::\n // - \"New Line (U+000A)\"\n // - \"Carriage Return (U+000D)\" [lookahead != \"New Line (U+000A)\"]\n // - \"Carriage Return (U+000D)\" \"New Line (U+000A)\"\n\n case 0x000a:\n // \\n\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n\n case 0x000d:\n // \\r\n if (body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n // Comment\n\n case 0x0023:\n // #\n return readComment(lexer, position);\n // Token ::\n // - Punctuator\n // - Name\n // - IntValue\n // - FloatValue\n // - StringValue\n //\n // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }\n\n case 0x0021:\n // !\n return createToken(lexer, TokenKind.BANG, position, position + 1);\n\n case 0x0024:\n // $\n return createToken(lexer, TokenKind.DOLLAR, position, position + 1);\n\n case 0x0026:\n // &\n return createToken(lexer, TokenKind.AMP, position, position + 1);\n\n case 0x0028:\n // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n\n case 0x0029:\n // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n\n case 0x002e:\n // .\n if (\n body.charCodeAt(position + 1) === 0x002e &&\n body.charCodeAt(position + 2) === 0x002e\n ) {\n return createToken(lexer, TokenKind.SPREAD, position, position + 3);\n }\n\n break;\n\n case 0x003a:\n // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n\n case 0x003d:\n // =\n return createToken(lexer, TokenKind.EQUALS, position, position + 1);\n\n case 0x0040:\n // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n\n case 0x005b:\n // [\n return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);\n\n case 0x005d:\n // ]\n return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);\n\n case 0x007b:\n // {\n return createToken(lexer, TokenKind.BRACE_L, position, position + 1);\n\n case 0x007c:\n // |\n return createToken(lexer, TokenKind.PIPE, position, position + 1);\n\n case 0x007d:\n // }\n return createToken(lexer, TokenKind.BRACE_R, position, position + 1);\n // StringValue\n\n case 0x0022:\n // \"\n if (\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n return readBlockString(lexer, position);\n }\n\n return readString(lexer, position);\n } // IntValue | FloatValue (Digit | -)\n\n if (isDigit(code) || code === 0x002d) {\n return readNumber(lexer, position, code);\n } // Name\n\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n code === 0x0027\n ? 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?'\n : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position)\n ? `Unexpected character: ${printCodePointAt(lexer, position)}.`\n : `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n/**\n * Reads a comment token from the source file.\n *\n * ```\n * Comment :: # CommentChar* [lookahead != CommentChar]\n *\n * CommentChar :: SourceCharacter but not LineTerminator\n * ```\n */\n\nfunction readComment(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}\n/**\n * Reads a number token from the source file, either a FloatValue or an IntValue\n * depending on whether a FractionalPart or ExponentPart is encountered.\n *\n * ```\n * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]\n *\n * IntegerPart ::\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit Digit*\n *\n * NegativeSign :: -\n *\n * NonZeroDigit :: Digit but not `0`\n *\n * FloatValue ::\n * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n *\n * FractionalPart :: . Digit+\n *\n * ExponentPart :: ExponentIndicator Sign? Digit+\n *\n * ExponentIndicator :: one of `e` `E`\n *\n * Sign :: one of + -\n * ```\n */\n\nfunction readNumber(lexer, start, firstCode) {\n const body = lexer.source.body;\n let position = start;\n let code = firstCode;\n let isFloat = false; // NegativeSign (-)\n\n if (code === 0x002d) {\n code = body.charCodeAt(++position);\n } // Zero (0)\n\n if (code === 0x0030) {\n code = body.charCodeAt(++position);\n\n if (isDigit(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, unexpected digit after 0: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n } else {\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Full stop (.)\n\n if (code === 0x002e) {\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // E e\n\n if (code === 0x0045 || code === 0x0065) {\n isFloat = true;\n code = body.charCodeAt(++position); // + -\n\n if (code === 0x002b || code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n if (code === 0x002e || isNameStart(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n\n return createToken(\n lexer,\n isFloat ? TokenKind.FLOAT : TokenKind.INT,\n start,\n position,\n body.slice(start, position),\n );\n}\n/**\n * Returns the new position in the source after reading one or more digits.\n */\n\nfunction readDigits(lexer, start, firstCode) {\n if (!isDigit(firstCode)) {\n throw syntaxError(\n lexer.source,\n start,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n start,\n )}.`,\n );\n }\n\n const body = lexer.source.body;\n let position = start + 1; // +1 to skip first firstCode\n\n while (isDigit(body.charCodeAt(position))) {\n ++position;\n }\n\n return position;\n}\n/**\n * Reads a single-quote string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"` [lookahead != `\"`]\n * - `\"` StringCharacter+ `\"`\n *\n * StringCharacter ::\n * - SourceCharacter but not `\"` or `\\` or LineTerminator\n * - `\\u` EscapedUnicode\n * - `\\` EscapedCharacter\n *\n * EscapedUnicode ::\n * - `{` HexDigit+ `}`\n * - HexDigit HexDigit HexDigit HexDigit\n *\n * EscapedCharacter :: one of `\"` `\\` `/` `b` `f` `n` `r` `t`\n * ```\n */\n\nfunction readString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n let chunkStart = position;\n let value = '';\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Quote (\")\n\n if (code === 0x0022) {\n value += body.slice(chunkStart, position);\n return createToken(lexer, TokenKind.STRING, start, position + 1, value);\n } // Escape Sequence (\\)\n\n if (code === 0x005c) {\n value += body.slice(chunkStart, position);\n const escape =\n body.charCodeAt(position + 1) === 0x0075 // u\n ? body.charCodeAt(position + 2) === 0x007b // {\n ? readEscapedUnicodeVariableWidth(lexer, position)\n : readEscapedUnicodeFixedWidth(lexer, position)\n : readEscapedCharacter(lexer, position);\n value += escape.value;\n position += escape.size;\n chunkStart = position;\n continue;\n } // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n} // The string value and lexed size of an escape sequence.\n\nfunction readEscapedUnicodeVariableWidth(lexer, position) {\n const body = lexer.source.body;\n let point = 0;\n let size = 3; // Cannot be larger than 12 chars (\\u{00000000}).\n\n while (size < 12) {\n const code = body.charCodeAt(position + size++); // Closing Brace (})\n\n if (code === 0x007d) {\n // Must be at least 5 chars (\\u{0}) and encode a Unicode scalar value.\n if (size < 5 || !isUnicodeScalarValue(point)) {\n break;\n }\n\n return {\n value: String.fromCodePoint(point),\n size,\n };\n } // Append this hex digit to the code point.\n\n point = (point << 4) | readHexDigit(code);\n\n if (point < 0) {\n break;\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(\n position,\n position + size,\n )}\".`,\n );\n}\n\nfunction readEscapedUnicodeFixedWidth(lexer, position) {\n const body = lexer.source.body;\n const code = read16BitHexCode(body, position + 2);\n\n if (isUnicodeScalarValue(code)) {\n return {\n value: String.fromCodePoint(code),\n size: 6,\n };\n } // GraphQL allows JSON-style surrogate pair escape sequences, but only when\n // a valid pair is formed.\n\n if (isLeadingSurrogate(code)) {\n // \\u\n if (\n body.charCodeAt(position + 6) === 0x005c &&\n body.charCodeAt(position + 7) === 0x0075\n ) {\n const trailingCode = read16BitHexCode(body, position + 8);\n\n if (isTrailingSurrogate(trailingCode)) {\n // JavaScript defines strings as a sequence of UTF-16 code units and\n // encodes Unicode code points above U+FFFF using a surrogate pair of\n // code units. Since this is a surrogate pair escape sequence, just\n // include both codes into the JavaScript string value. Had JavaScript\n // not been internally based on UTF-16, then this surrogate pair would\n // be decoded to retrieve the supplementary code point.\n return {\n value: String.fromCodePoint(code, trailingCode),\n size: 12,\n };\n }\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(position, position + 6)}\".`,\n );\n}\n/**\n * Reads four hexadecimal characters and returns the positive integer that 16bit\n * hexadecimal string represents. For example, \"000f\" will return 15, and \"dead\"\n * will return 57005.\n *\n * Returns a negative number if any char was not a valid hexadecimal digit.\n */\n\nfunction read16BitHexCode(body, position) {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}\n/**\n * Reads a hexadecimal character and returns its positive integer value (0-15).\n *\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 if the provided character code was not a valid hexadecimal digit.\n *\n * HexDigit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * - `A` `B` `C` `D` `E` `F`\n * - `a` `b` `c` `d` `e` `f`\n */\n\nfunction readHexDigit(code) {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}\n/**\n * | Escaped Character | Code Point | Character Name |\n * | ----------------- | ---------- | ---------------------------- |\n * | `\"` | U+0022 | double quote |\n * | `\\` | U+005C | reverse solidus (back slash) |\n * | `/` | U+002F | solidus (forward slash) |\n * | `b` | U+0008 | backspace |\n * | `f` | U+000C | form feed |\n * | `n` | U+000A | line feed (new line) |\n * | `r` | U+000D | carriage return |\n * | `t` | U+0009 | horizontal tab |\n */\n\nfunction readEscapedCharacter(lexer, position) {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n\n switch (code) {\n case 0x0022:\n // \"\n return {\n value: '\\u0022',\n size: 2,\n };\n\n case 0x005c:\n // \\\n return {\n value: '\\u005c',\n size: 2,\n };\n\n case 0x002f:\n // /\n return {\n value: '\\u002f',\n size: 2,\n };\n\n case 0x0062:\n // b\n return {\n value: '\\u0008',\n size: 2,\n };\n\n case 0x0066:\n // f\n return {\n value: '\\u000c',\n size: 2,\n };\n\n case 0x006e:\n // n\n return {\n value: '\\u000a',\n size: 2,\n };\n\n case 0x0072:\n // r\n return {\n value: '\\u000d',\n size: 2,\n };\n\n case 0x0074:\n // t\n return {\n value: '\\u0009',\n size: 2,\n };\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}\n/**\n * Reads a block string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"\"` BlockStringCharacter* `\"\"\"`\n *\n * BlockStringCharacter ::\n * - SourceCharacter but not `\"\"\"` or `\\\"\"\"`\n * - `\\\"\"\"`\n * ```\n */\n\nfunction readBlockString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n const blockLines = [];\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Triple-Quote (\"\"\")\n\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n const token = createToken(\n lexer,\n TokenKind.BLOCK_STRING,\n start,\n position + 3, // Return a string of the lines joined with U+000A.\n dedentBlockStringLines(blockLines).join('\\n'),\n );\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n } // Escaped Triple-Quote (\\\"\"\")\n\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n\n position += 4;\n continue;\n } // LineTerminator\n\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * ```\n * Name ::\n * - NameStart NameContinue* [lookahead != NameContinue]\n * ```\n */\n\nfunction readName(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n if (isNameContinue(code)) {\n ++position;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.NAME,\n start,\n position,\n body.slice(start, position),\n );\n}\n","const MAX_ARRAY_LENGTH = 10;\nconst MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (typeof value) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? `[function ${value.name}]` : '[function]';\n\n case 'object':\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (value === null) {\n return 'null';\n }\n\n if (previouslySeenValues.includes(value)) {\n return '[Circular]';\n }\n\n const seenValues = [...previouslySeenValues, value];\n\n if (isJSONable(value)) {\n const jsonValue = value.toJSON(); // check for infinite recursion\n\n if (jsonValue !== value) {\n return typeof jsonValue === 'string'\n ? jsonValue\n : formatValue(jsonValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction isJSONable(value) {\n return typeof value.toJSON === 'function';\n}\n\nfunction formatObject(object, seenValues) {\n const entries = Object.entries(object);\n\n if (entries.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n const properties = entries.map(\n ([key, value]) => key + ': ' + formatValue(value, seenValues),\n );\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n const len = Math.min(MAX_ARRAY_LENGTH, array.length);\n const remaining = array.length - len;\n const items = [];\n\n for (let i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(`... ${remaining} more items`);\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getObjectTag(object) {\n const tag = Object.prototype.toString\n .call(object)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n const name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","import { inspect } from './inspect.mjs';\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\n\nexport const instanceOf =\n /* c8 ignore next 6 */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n globalThis.process && globalThis.process.env.NODE_ENV === 'production'\n ? function instanceOf(value, constructor) {\n return value instanceof constructor;\n }\n : function instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (typeof value === 'object' && value !== null) {\n var _value$constructor;\n\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009\n ? value[Symbol.toStringTag]\n : (_value$constructor = value.constructor) === null ||\n _value$constructor === void 0\n ? void 0\n : _value$constructor.name;\n\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(`Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`);\n }\n }\n\n return false;\n };\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport class Source {\n constructor(\n body,\n name = 'GraphQL request',\n locationOffset = {\n line: 1,\n column: 1,\n },\n ) {\n typeof body === 'string' ||\n devAssert(false, `Body must be a string. Received: ${inspect(body)}.`);\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 ||\n devAssert(\n false,\n 'line in locationOffset is 1-indexed and must be positive.',\n );\n this.locationOffset.column > 0 ||\n devAssert(\n false,\n 'column in locationOffset is 1-indexed and must be positive.',\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'Source';\n }\n}\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Location, OperationTypeNode } from './ast.mjs';\nimport { DirectiveLocation } from './directiveLocation.mjs';\nimport { Kind } from './kinds.mjs';\nimport { isPunctuatorTokenKind, Lexer } from './lexer.mjs';\nimport { isSource, Source } from './source.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n const parser = new Parser(source, options);\n return parser.parseDocument();\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Similar to parseValue(), but raises a parse error if it encounters a\n * variable. The return type will be a constant value.\n */\n\nexport function parseConstValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseConstValueLiteral();\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport class Parser {\n constructor(source, options = {}) {\n const sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n this._tokenCounter = 0;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n parseName() {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n\n parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n *\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n\n parseDefinition() {\n if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } // Many definitions begin with a description and require a lookahead.\n\n const hasDescription = this.peekDescription();\n const keywordToken = hasDescription\n ? this._lexer.lookahead()\n : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n\n if (hasDescription) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, descriptions are supported only on type definitions.',\n );\n }\n\n switch (keywordToken.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n\n parseOperationDefinition() {\n const start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n const operation = this.parseOperationType();\n let name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation,\n name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * OperationType : one of query mutation subscription\n */\n\n parseOperationType() {\n const operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n\n case 'mutation':\n return OperationTypeNode.MUTATION;\n\n case 'subscription':\n return OperationTypeNode.SUBSCRIPTION;\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n\n parseVariableDefinitions() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n\n parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseConstValueLiteral()\n : undefined,\n directives: this.parseConstDirectives(),\n });\n }\n /**\n * Variable : $ Name\n */\n\n parseVariable() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return this.node(start, {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n });\n }\n /**\n * ```\n * SelectionSet : { Selection+ }\n * ```\n */\n\n parseSelectionSet() {\n return this.node(this._lexer.token, {\n kind: Kind.SELECTION_SET,\n selections: this.many(\n TokenKind.BRACE_L,\n this.parseSelection,\n TokenKind.BRACE_R,\n ),\n });\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n\n parseSelection() {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n\n parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n\n parseArguments(isConst) {\n const item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n\n parseArgument(isConst = false) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n parseConstArgument() {\n return this.parseArgument(true);\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n\n parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n });\n }\n\n return this.node(start, {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n\n parseFragmentDefinition() {\n const start = this._lexer.token;\n this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (this._options.allowLegacyFragmentVariables === true) {\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentName : Name but not `on`\n */\n\n parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n\n case TokenKind.FLOAT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this.advanceLexer();\n\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n\n case 'null':\n return this.node(token, {\n kind: Kind.NULL,\n });\n\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n\n return this.parseVariable();\n\n default:\n throw this.unexpected();\n }\n }\n\n parseConstValueLiteral() {\n return this.parseValueLiteral(true);\n }\n\n parseStringLiteral() {\n const token = this._lexer.token;\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n });\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n\n parseList(isConst) {\n const item = () => this.parseValueLiteral(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }\n /**\n * ```\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n * ```\n */\n\n parseObject(isConst) {\n const item = () => this.parseObjectField(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n });\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n\n parseObjectField(isConst) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.OBJECT_FIELD,\n name,\n value: this.parseValueLiteral(isConst),\n });\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n\n parseDirectives(isConst) {\n const directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n\n parseConstDirectives() {\n return this.parseDirectives(true);\n }\n /**\n * ```\n * Directive[Const] : @ Name Arguments[?Const]?\n * ```\n */\n\n parseDirective(isConst) {\n const start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return this.node(start, {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n });\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n\n parseTypeReference() {\n const start = this._lexer.token;\n let type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n const innerType = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = this.node(start, {\n kind: Kind.LIST_TYPE,\n type: innerType,\n });\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return this.node(start, {\n kind: Kind.NON_NULL_TYPE,\n type,\n });\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n\n parseNamedType() {\n return this.node(this._lexer.token, {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n });\n } // Implements the parsing rules in the Type Definition section.\n\n peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n\n parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * ```\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n * ```\n */\n\n parseSchemaDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.many(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n return this.node(start, {\n kind: Kind.SCHEMA_DEFINITION,\n description,\n directives,\n operationTypes,\n });\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n\n parseOperationTypeDefinition() {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n });\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n\n parseScalarTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n\n parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n\n parseImplementsInterfaces() {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : [];\n }\n /**\n * ```\n * FieldsDefinition : { FieldDefinition+ }\n * ```\n */\n\n parseFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseFieldDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n\n parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n\n parseArgumentDefs() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n\n parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseConstValueLiteral();\n }\n\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description,\n name,\n type,\n defaultValue,\n directives,\n });\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n\n parseInterfaceTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n\n parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n\n parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n\n parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(start, {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description,\n name,\n directives,\n values,\n });\n }\n /**\n * ```\n * EnumValuesDefinition : { EnumValueDefinition+ }\n * ```\n */\n\n parseEnumValuesDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseEnumValueDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n */\n\n parseEnumValueDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseEnumValueName() {\n if (\n this._lexer.token.value === 'true' ||\n this._lexer.token.value === 'false' ||\n this._lexer.token.value === 'null'\n ) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this._lexer.token,\n )} is reserved and cannot be used for an enum value.`,\n );\n }\n\n return this.parseName();\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n\n parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * InputFieldsDefinition : { InputValueDefinition+ }\n * ```\n */\n\n parseInputFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseInputValueDef,\n TokenKind.BRACE_R,\n );\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n\n parseTypeSystemExtension() {\n const keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * ```\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n * ```\n */\n\n parseSchemaExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.optionalMany(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCHEMA_EXTENSION,\n directives,\n operationTypes,\n });\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n\n parseScalarTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n\n parseObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n\n parseInterfaceTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n\n parseUnionTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.UNION_TYPE_EXTENSION,\n name,\n directives,\n types,\n });\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n\n parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name,\n directives,\n values,\n });\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n\n parseInputObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n * ```\n */\n\n parseDirectiveDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n const repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n const locations = this.parseDirectiveLocations();\n return this.node(start, {\n kind: Kind.DIRECTIVE_DEFINITION,\n description,\n name,\n arguments: args,\n repeatable,\n locations,\n });\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n\n parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n\n parseDirectiveLocation() {\n const start = this._lexer.token;\n const name = this.parseName();\n\n if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a node that, if configured to do so, sets a \"loc\" field as a\n * location object, used to identify the place in the source that created a\n * given parsed object.\n */\n\n node(startToken, node) {\n if (this._options.noLocation !== true) {\n node.loc = new Location(\n startToken,\n this._lexer.lastToken,\n this._lexer.source,\n );\n }\n\n return node;\n }\n /**\n * Determines if the next token is of a given kind\n */\n\n peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return token;\n }\n\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`,\n );\n }\n /**\n * If the next token is of the given kind, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n } else {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected \"${value}\", found ${getTokenDesc(token)}.`,\n );\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n\n unexpected(atToken) {\n const token =\n atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected ${getTokenDesc(token)}.`,\n );\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n\n delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n }\n\n advanceLexer() {\n const { maxTokens } = this._options;\n\n const token = this._lexer.advance();\n\n if (maxTokens !== undefined && token.kind !== TokenKind.EOF) {\n ++this._tokenCounter;\n\n if (this._tokenCounter > maxTokens) {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Document contains more that ${maxTokens} tokens. Parsing aborted.`,\n );\n }\n }\n }\n}\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n const value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? ` \"${value}\"` : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? `\"${kind}\"` : kind;\n}\n","/**\n * Prints a string as a GraphQL StringValue literal. Replaces control characters\n * and excluded characters (\" U+0022 and \\\\ U+005C) with escape sequences.\n */\nexport function printString(str) {\n return `\"${str.replace(escapedRegExp, escapedReplacer)}\"`;\n} // eslint-disable-next-line no-control-regex\n\nconst escapedRegExp = /[\\x00-\\x1f\\x22\\x5c\\x7f-\\x9f]/g;\n\nfunction escapedReplacer(str) {\n return escapeSequences[str.charCodeAt(0)];\n} // prettier-ignore\n\nconst escapeSequences = [\n '\\\\u0000',\n '\\\\u0001',\n '\\\\u0002',\n '\\\\u0003',\n '\\\\u0004',\n '\\\\u0005',\n '\\\\u0006',\n '\\\\u0007',\n '\\\\b',\n '\\\\t',\n '\\\\n',\n '\\\\u000B',\n '\\\\f',\n '\\\\r',\n '\\\\u000E',\n '\\\\u000F',\n '\\\\u0010',\n '\\\\u0011',\n '\\\\u0012',\n '\\\\u0013',\n '\\\\u0014',\n '\\\\u0015',\n '\\\\u0016',\n '\\\\u0017',\n '\\\\u0018',\n '\\\\u0019',\n '\\\\u001A',\n '\\\\u001B',\n '\\\\u001C',\n '\\\\u001D',\n '\\\\u001E',\n '\\\\u001F',\n '',\n '',\n '\\\\\"',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 2F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 3F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 4F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\\\\\',\n '',\n '',\n '', // 5F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 6F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\u007F',\n '\\\\u0080',\n '\\\\u0081',\n '\\\\u0082',\n '\\\\u0083',\n '\\\\u0084',\n '\\\\u0085',\n '\\\\u0086',\n '\\\\u0087',\n '\\\\u0088',\n '\\\\u0089',\n '\\\\u008A',\n '\\\\u008B',\n '\\\\u008C',\n '\\\\u008D',\n '\\\\u008E',\n '\\\\u008F',\n '\\\\u0090',\n '\\\\u0091',\n '\\\\u0092',\n '\\\\u0093',\n '\\\\u0094',\n '\\\\u0095',\n '\\\\u0096',\n '\\\\u0097',\n '\\\\u0098',\n '\\\\u0099',\n '\\\\u009A',\n '\\\\u009B',\n '\\\\u009C',\n '\\\\u009D',\n '\\\\u009E',\n '\\\\u009F',\n];\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isNode, QueryDocumentKeys } from './ast.mjs';\nimport { Kind } from './kinds.mjs';\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport const BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * ```ts\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n * ```\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to three permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n * ```\n *\n * 2) Named visitors that trigger upon entering and leaving a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n * ```\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * ```ts\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n * ```\n */\n\nexport function visit(root, visitor, visitorKeys = QueryDocumentKeys) {\n const enterLeaveMap = new Map();\n\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n /* eslint-disable no-undef-init */\n\n let stack = undefined;\n let inArray = Array.isArray(root);\n let keys = [root];\n let index = -1;\n let edits = [];\n let node = root;\n let key = undefined;\n let parent = undefined;\n const path = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n let editOffset = 0;\n\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = Object.defineProperties(\n {},\n Object.getOwnPropertyDescriptors(node),\n );\n\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent) {\n key = inArray ? index : keys[index];\n node = parent[key];\n\n if (node === null || node === undefined) {\n continue;\n }\n\n path.push(key);\n }\n\n let result;\n\n if (!Array.isArray(node)) {\n var _enterLeaveMap$get, _enterLeaveMap$get2;\n\n isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);\n const visitFn = isLeaving\n ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get === void 0\n ? void 0\n : _enterLeaveMap$get.leave\n : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get2 === void 0\n ? void 0\n : _enterLeaveMap$get2.enter;\n result =\n visitFn === null || visitFn === void 0\n ? void 0\n : visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _node$kind;\n\n stack = {\n inArray,\n index,\n keys,\n edits,\n prev: stack,\n };\n inArray = Array.isArray(node);\n keys = inArray\n ? node\n : (_node$kind = visitorKeys[node.kind]) !== null &&\n _node$kind !== void 0\n ? _node$kind\n : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits[edits.length - 1][1];\n }\n\n return root;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor || (hasVisitor = enter != null || leave != null);\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave = {\n enter(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _enterList$i;\n\n const result =\n (_enterList$i = enterList[i]) === null || _enterList$i === void 0\n ? void 0\n : _enterList$i.apply(visitors[i], args);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n\n leave(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _leaveList$i;\n\n const result =\n (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0\n ? void 0\n : _leaveList$i.apply(visitors[i], args);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n */\n\nexport function getEnterLeaveForKind(visitor, kind) {\n const kindVisitor = visitor[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return {\n enter: kindVisitor,\n leave: undefined,\n };\n } // { enter() {}, leave() {} }\n\n return {\n enter: visitor.enter,\n leave: visitor.leave,\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n *\n * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17\n */\n\n/* c8 ignore next 8 */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n const { enter, leave } = getEnterLeaveForKind(visitor, kind);\n return isLeaving ? leave : enter;\n}\n","import { printBlockString } from './blockString.mjs';\nimport { printString } from './printString.mjs';\nimport { visit } from './visitor.mjs';\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, printDocASTReducer);\n}\nconst MAX_LINE_LENGTH = 80;\nconst printDocASTReducer = {\n Name: {\n leave: (node) => node.value,\n },\n Variable: {\n leave: (node) => '$' + node.name,\n },\n // Document\n Document: {\n leave: (node) => join(node.definitions, '\\n\\n'),\n },\n OperationDefinition: {\n leave(node) {\n const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n const prefix = join(\n [\n node.operation,\n join([node.name, varDefs]),\n join(node.directives, ' '),\n ],\n ' ',\n ); // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;\n },\n },\n VariableDefinition: {\n leave: ({ variable, type, defaultValue, directives }) =>\n variable +\n ': ' +\n type +\n wrap(' = ', defaultValue) +\n wrap(' ', join(directives, ' ')),\n },\n SelectionSet: {\n leave: ({ selections }) => block(selections),\n },\n Field: {\n leave({ alias, name, arguments: args, directives, selectionSet }) {\n const prefix = wrap('', alias, ': ') + name;\n let argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n },\n Argument: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Fragments\n FragmentSpread: {\n leave: ({ name, directives }) =>\n '...' + name + wrap(' ', join(directives, ' ')),\n },\n InlineFragment: {\n leave: ({ typeCondition, directives, selectionSet }) =>\n join(\n [\n '...',\n wrap('on ', typeCondition),\n join(directives, ' '),\n selectionSet,\n ],\n ' ',\n ),\n },\n FragmentDefinition: {\n leave: (\n { name, typeCondition, variableDefinitions, directives, selectionSet }, // Note: fragment variable definitions are experimental and may be changed\n ) =>\n // or removed in the future.\n `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +\n `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +\n selectionSet,\n },\n // Value\n IntValue: {\n leave: ({ value }) => value,\n },\n FloatValue: {\n leave: ({ value }) => value,\n },\n StringValue: {\n leave: ({ value, block: isBlockString }) =>\n isBlockString ? printBlockString(value) : printString(value),\n },\n BooleanValue: {\n leave: ({ value }) => (value ? 'true' : 'false'),\n },\n NullValue: {\n leave: () => 'null',\n },\n EnumValue: {\n leave: ({ value }) => value,\n },\n ListValue: {\n leave: ({ values }) => '[' + join(values, ', ') + ']',\n },\n ObjectValue: {\n leave: ({ fields }) => '{' + join(fields, ', ') + '}',\n },\n ObjectField: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Directive\n Directive: {\n leave: ({ name, arguments: args }) =>\n '@' + name + wrap('(', join(args, ', '), ')'),\n },\n // Type\n NamedType: {\n leave: ({ name }) => name,\n },\n ListType: {\n leave: ({ type }) => '[' + type + ']',\n },\n NonNullType: {\n leave: ({ type }) => type + '!',\n },\n // Type System Definitions\n SchemaDefinition: {\n leave: ({ description, directives, operationTypes }) =>\n wrap('', description, '\\n') +\n join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n },\n OperationTypeDefinition: {\n leave: ({ operation, type }) => operation + ': ' + type,\n },\n ScalarTypeDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') +\n join(['scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n FieldDefinition: {\n leave: ({ description, name, arguments: args, type, directives }) =>\n wrap('', description, '\\n') +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n ': ' +\n type +\n wrap(' ', join(directives, ' ')),\n },\n InputValueDefinition: {\n leave: ({ description, name, type, defaultValue, directives }) =>\n wrap('', description, '\\n') +\n join(\n [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],\n ' ',\n ),\n },\n InterfaceTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeDefinition: {\n leave: ({ description, name, directives, types }) =>\n wrap('', description, '\\n') +\n join(\n ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],\n ' ',\n ),\n },\n EnumTypeDefinition: {\n leave: ({ description, name, directives, values }) =>\n wrap('', description, '\\n') +\n join(['enum', name, join(directives, ' '), block(values)], ' '),\n },\n EnumValueDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') + join([name, join(directives, ' ')], ' '),\n },\n InputObjectTypeDefinition: {\n leave: ({ description, name, directives, fields }) =>\n wrap('', description, '\\n') +\n join(['input', name, join(directives, ' '), block(fields)], ' '),\n },\n DirectiveDefinition: {\n leave: ({ description, name, arguments: args, repeatable, locations }) =>\n wrap('', description, '\\n') +\n 'directive @' +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n (repeatable ? ' repeatable' : '') +\n ' on ' +\n join(locations, ' | '),\n },\n SchemaExtension: {\n leave: ({ directives, operationTypes }) =>\n join(\n ['extend schema', join(directives, ' '), block(operationTypes)],\n ' ',\n ),\n },\n ScalarTypeExtension: {\n leave: ({ name, directives }) =>\n join(['extend scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n InterfaceTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeExtension: {\n leave: ({ name, directives, types }) =>\n join(\n [\n 'extend union',\n name,\n join(directives, ' '),\n wrap('= ', join(types, ' | ')),\n ],\n ' ',\n ),\n },\n EnumTypeExtension: {\n leave: ({ name, directives, values }) =>\n join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n },\n InputObjectTypeExtension: {\n leave: ({ name, directives, fields }) =>\n join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n },\n};\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\nfunction join(maybeArray, separator = '') {\n var _maybeArray$filter$jo;\n\n return (_maybeArray$filter$jo =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.filter((x) => x).join(separator)) !== null &&\n _maybeArray$filter$jo !== void 0\n ? _maybeArray$filter$jo\n : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an indented `{ }` block.\n */\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\nfunction wrap(start, maybeString, end = '') {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction hasMultilineItems(maybeArray) {\n var _maybeArray$some;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n return (_maybeArray$some =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.some((str) => str.includes('\\n'))) !== null &&\n _maybeArray$some !== void 0\n ? _maybeArray$some\n : false;\n}\n","import { Kind } from './kinds.mjs';\nexport function isDefinitionNode(node) {\n return (\n isExecutableDefinitionNode(node) ||\n isTypeSystemDefinitionNode(node) ||\n isTypeSystemExtensionNode(node)\n );\n}\nexport function isExecutableDefinitionNode(node) {\n return (\n node.kind === Kind.OPERATION_DEFINITION ||\n node.kind === Kind.FRAGMENT_DEFINITION\n );\n}\nexport function isSelectionNode(node) {\n return (\n node.kind === Kind.FIELD ||\n node.kind === Kind.FRAGMENT_SPREAD ||\n node.kind === Kind.INLINE_FRAGMENT\n );\n}\nexport function isValueNode(node) {\n return (\n node.kind === Kind.VARIABLE ||\n node.kind === Kind.INT ||\n node.kind === Kind.FLOAT ||\n node.kind === Kind.STRING ||\n node.kind === Kind.BOOLEAN ||\n node.kind === Kind.NULL ||\n node.kind === Kind.ENUM ||\n node.kind === Kind.LIST ||\n node.kind === Kind.OBJECT\n );\n}\nexport function isConstValueNode(node) {\n return (\n isValueNode(node) &&\n (node.kind === Kind.LIST\n ? node.values.some(isConstValueNode)\n : node.kind === Kind.OBJECT\n ? node.fields.some((field) => isConstValueNode(field.value))\n : node.kind !== Kind.VARIABLE)\n );\n}\nexport function isTypeNode(node) {\n return (\n node.kind === Kind.NAMED_TYPE ||\n node.kind === Kind.LIST_TYPE ||\n node.kind === Kind.NON_NULL_TYPE\n );\n}\nexport function isTypeSystemDefinitionNode(node) {\n return (\n node.kind === Kind.SCHEMA_DEFINITION ||\n isTypeDefinitionNode(node) ||\n node.kind === Kind.DIRECTIVE_DEFINITION\n );\n}\nexport function isTypeDefinitionNode(node) {\n return (\n node.kind === Kind.SCALAR_TYPE_DEFINITION ||\n node.kind === Kind.OBJECT_TYPE_DEFINITION ||\n node.kind === Kind.INTERFACE_TYPE_DEFINITION ||\n node.kind === Kind.UNION_TYPE_DEFINITION ||\n node.kind === Kind.ENUM_TYPE_DEFINITION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION\n );\n}\nexport function isTypeSystemExtensionNode(node) {\n return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node);\n}\nexport function isTypeExtensionNode(node) {\n return (\n node.kind === Kind.SCALAR_TYPE_EXTENSION ||\n node.kind === Kind.OBJECT_TYPE_EXTENSION ||\n node.kind === Kind.INTERFACE_TYPE_EXTENSION ||\n node.kind === Kind.UNION_TYPE_EXTENSION ||\n node.kind === Kind.ENUM_TYPE_EXTENSION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n );\n}\n","import { remove } from \"ts-invariant/process/index.js\";\nimport { Source } from 'graphql';\nexport function removeTemporaryGlobals() {\n return typeof Source === \"function\" ? remove() : remove();\n}\n//# sourceMappingURL=fix-graphql.js.map","import { invariant, InvariantError } from \"ts-invariant\";\nimport DEV from \"./DEV.js\";\nexport { DEV };\nexport function checkDEV() {\n __DEV__ ? invariant(\"boolean\" === typeof DEV, DEV) : invariant(\"boolean\" === typeof DEV, 39);\n}\nimport { removeTemporaryGlobals } from \"./fix-graphql.js\";\nremoveTemporaryGlobals();\nexport { maybe } from \"./maybe.js\";\nexport { default as global } from \"./global.js\";\nexport { invariant, InvariantError };\ncheckDEV();\n//# sourceMappingURL=index.js.map","import { invariant } from \"../globals/index.js\";\nimport { visit, BREAK, } from 'graphql';\nexport function shouldInclude(_a, variables) {\n var directives = _a.directives;\n if (!directives || !directives.length) {\n return true;\n }\n return getInclusionDirectives(directives).every(function (_a) {\n var directive = _a.directive, ifArgument = _a.ifArgument;\n var evaledValue = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables && variables[ifArgument.value.name.value];\n __DEV__ ? invariant(evaledValue !== void 0, \"Invalid variable referenced in @\".concat(directive.name.value, \" directive.\")) : invariant(evaledValue !== void 0, 40);\n }\n else {\n evaledValue = ifArgument.value.value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\nexport function getDirectiveNames(root) {\n var names = [];\n visit(root, {\n Directive: function (node) {\n names.push(node.name.value);\n },\n });\n return names;\n}\nexport var hasAnyDirectives = function (names, root) { return hasDirectives(names, root, false); };\nexport var hasAllDirectives = function (names, root) { return hasDirectives(names, root, true); };\nexport function hasDirectives(names, root, all) {\n var nameSet = new Set(names);\n var uniqueCount = nameSet.size;\n visit(root, {\n Directive: function (node) {\n if (nameSet.delete(node.name.value) &&\n (!all || !nameSet.size)) {\n return BREAK;\n }\n },\n });\n return all ? !nameSet.size : nameSet.size < uniqueCount;\n}\nexport function hasClientExports(document) {\n return document && hasDirectives(['client', 'export'], document, true);\n}\nfunction isInclusionDirective(_a) {\n var value = _a.name.value;\n return value === 'skip' || value === 'include';\n}\nexport function getInclusionDirectives(directives) {\n var result = [];\n if (directives && directives.length) {\n directives.forEach(function (directive) {\n if (!isInclusionDirective(directive))\n return;\n var directiveArguments = directive.arguments;\n var directiveName = directive.name.value;\n __DEV__ ? invariant(directiveArguments && directiveArguments.length === 1, \"Incorrect number of arguments for the @\".concat(directiveName, \" directive.\")) : invariant(directiveArguments && directiveArguments.length === 1, 41);\n var ifArgument = directiveArguments[0];\n __DEV__ ? invariant(ifArgument.name && ifArgument.name.value === 'if', \"Invalid argument for the @\".concat(directiveName, \" directive.\")) : invariant(ifArgument.name && ifArgument.name.value === 'if', 42);\n var ifValue = ifArgument.value;\n __DEV__ ? invariant(ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), \"Argument for the @\".concat(directiveName, \" directive must be a variable or a boolean value.\")) : invariant(ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 43);\n result.push({ directive: directive, ifArgument: ifArgument });\n });\n }\n return result;\n}\n//# sourceMappingURL=directives.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport { invariant, InvariantError } from \"../globals/index.js\";\nexport function getFragmentQueryDocument(document, fragmentName) {\n var actualFragmentName = fragmentName;\n var fragments = [];\n document.definitions.forEach(function (definition) {\n if (definition.kind === 'OperationDefinition') {\n throw __DEV__ ? new InvariantError(\"Found a \".concat(definition.operation, \" operation\").concat(definition.name ? \" named '\".concat(definition.name.value, \"'\") : '', \". \") +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new InvariantError(44);\n }\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n if (typeof actualFragmentName === 'undefined') {\n __DEV__ ? invariant(fragments.length === 1, \"Found \".concat(fragments.length, \" fragments. `fragmentName` must be provided when there is not exactly 1 fragment.\")) : invariant(fragments.length === 1, 45);\n actualFragmentName = fragments[0].name.value;\n }\n var query = __assign(__assign({}, document), { definitions: __spreadArray([\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n }\n ], document.definitions, true) });\n return query;\n}\nexport function createFragmentMap(fragments) {\n if (fragments === void 0) { fragments = []; }\n var symTable = {};\n fragments.forEach(function (fragment) {\n symTable[fragment.name.value] = fragment;\n });\n return symTable;\n}\nexport function getFragmentFromSelection(selection, fragmentMap) {\n switch (selection.kind) {\n case 'InlineFragment':\n return selection;\n case 'FragmentSpread': {\n var fragmentName = selection.name.value;\n if (typeof fragmentMap === \"function\") {\n return fragmentMap(fragmentName);\n }\n var fragment = fragmentMap && fragmentMap[fragmentName];\n __DEV__ ? invariant(fragment, \"No fragment named \".concat(fragmentName)) : invariant(fragment, 46);\n return fragment || null;\n }\n default:\n return null;\n }\n}\n//# sourceMappingURL=fragments.js.map","export function isNonNullObject(obj) {\n return obj !== null && typeof obj === 'object';\n}\n//# sourceMappingURL=objects.js.map","import { InvariantError } from \"../globals/index.js\";\nimport { isNonNullObject } from \"../common/objects.js\";\nimport { getFragmentFromSelection } from \"./fragments.js\";\nexport function makeReference(id) {\n return { __ref: String(id) };\n}\nexport function isReference(obj) {\n return Boolean(obj && typeof obj === 'object' && typeof obj.__ref === 'string');\n}\nexport function isDocumentNode(value) {\n return (isNonNullObject(value) &&\n value.kind === \"Document\" &&\n Array.isArray(value.definitions));\n}\nfunction isStringValue(value) {\n return value.kind === 'StringValue';\n}\nfunction isBooleanValue(value) {\n return value.kind === 'BooleanValue';\n}\nfunction isIntValue(value) {\n return value.kind === 'IntValue';\n}\nfunction isFloatValue(value) {\n return value.kind === 'FloatValue';\n}\nfunction isVariable(value) {\n return value.kind === 'Variable';\n}\nfunction isObjectValue(value) {\n return value.kind === 'ObjectValue';\n}\nfunction isListValue(value) {\n return value.kind === 'ListValue';\n}\nfunction isEnumValue(value) {\n return value.kind === 'EnumValue';\n}\nfunction isNullValue(value) {\n return value.kind === 'NullValue';\n}\nexport function valueToObjectRepresentation(argObj, name, value, variables) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n }\n else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n }\n else if (isObjectValue(value)) {\n var nestedArgObj_1 = {};\n value.fields.map(function (obj) {\n return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables);\n });\n argObj[name.value] = nestedArgObj_1;\n }\n else if (isVariable(value)) {\n var variableValue = (variables || {})[value.name.value];\n argObj[name.value] = variableValue;\n }\n else if (isListValue(value)) {\n argObj[name.value] = value.values.map(function (listValue) {\n var nestedArgArrayObj = {};\n valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables);\n return nestedArgArrayObj[name.value];\n });\n }\n else if (isEnumValue(value)) {\n argObj[name.value] = value.value;\n }\n else if (isNullValue(value)) {\n argObj[name.value] = null;\n }\n else {\n throw __DEV__ ? new InvariantError(\"The inline argument \\\"\".concat(name.value, \"\\\" of kind \\\"\").concat(value.kind, \"\\\"\") +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.') : new InvariantError(55);\n }\n}\nexport function storeKeyNameFromField(field, variables) {\n var directivesObj = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(function (directive) {\n directivesObj[directive.name.value] = {};\n if (directive.arguments) {\n directive.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables);\n });\n }\n });\n }\n var argObj = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(argObj, name, value, variables);\n });\n }\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\nvar KNOWN_DIRECTIVES = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\nexport var getStoreKeyName = Object.assign(function (fieldName, args, directives) {\n if (args &&\n directives &&\n directives['connection'] &&\n directives['connection']['key']) {\n if (directives['connection']['filter'] &&\n directives['connection']['filter'].length > 0) {\n var filterKeys = directives['connection']['filter']\n ? directives['connection']['filter']\n : [];\n filterKeys.sort();\n var filteredArgs_1 = {};\n filterKeys.forEach(function (key) {\n filteredArgs_1[key] = args[key];\n });\n return \"\".concat(directives['connection']['key'], \"(\").concat(stringify(filteredArgs_1), \")\");\n }\n else {\n return directives['connection']['key'];\n }\n }\n var completeFieldName = fieldName;\n if (args) {\n var stringifiedArgs = stringify(args);\n completeFieldName += \"(\".concat(stringifiedArgs, \")\");\n }\n if (directives) {\n Object.keys(directives).forEach(function (key) {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1)\n return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += \"@\".concat(key, \"(\").concat(stringify(directives[key]), \")\");\n }\n else {\n completeFieldName += \"@\".concat(key);\n }\n });\n }\n return completeFieldName;\n}, {\n setStringify: function (s) {\n var previous = stringify;\n stringify = s;\n return previous;\n },\n});\nvar stringify = function defaultStringify(value) {\n return JSON.stringify(value, stringifyReplacer);\n};\nfunction stringifyReplacer(_key, value) {\n if (isNonNullObject(value) && !Array.isArray(value)) {\n value = Object.keys(value).sort().reduce(function (copy, key) {\n copy[key] = value[key];\n return copy;\n }, {});\n }\n return value;\n}\nexport function argumentsObjectFromField(field, variables) {\n if (field.arguments && field.arguments.length) {\n var argObj_1 = {};\n field.arguments.forEach(function (_a) {\n var name = _a.name, value = _a.value;\n return valueToObjectRepresentation(argObj_1, name, value, variables);\n });\n return argObj_1;\n }\n return null;\n}\nexport function resultKeyNameFromField(field) {\n return field.alias ? field.alias.value : field.name.value;\n}\nexport function getTypenameFromResult(result, selectionSet, fragmentMap) {\n var fragments;\n for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {\n var selection = _a[_i];\n if (isField(selection)) {\n if (selection.name.value === '__typename') {\n return result[resultKeyNameFromField(selection)];\n }\n }\n else if (fragments) {\n fragments.push(selection);\n }\n else {\n fragments = [selection];\n }\n }\n if (typeof result.__typename === 'string') {\n return result.__typename;\n }\n if (fragments) {\n for (var _b = 0, fragments_1 = fragments; _b < fragments_1.length; _b++) {\n var selection = fragments_1[_b];\n var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);\n if (typeof typename === 'string') {\n return typename;\n }\n }\n }\n}\nexport function isField(selection) {\n return selection.kind === 'Field';\n}\nexport function isInlineFragment(selection) {\n return selection.kind === 'InlineFragment';\n}\n//# sourceMappingURL=storeUtils.js.map","import { invariant, InvariantError } from \"../globals/index.js\";\nimport { valueToObjectRepresentation } from \"./storeUtils.js\";\nexport function checkDocument(doc) {\n __DEV__ ? invariant(doc && doc.kind === 'Document', \"Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \\\"gql\\\" tag? http://docs.apollostack.com/apollo-client/core.html#gql\") : invariant(doc && doc.kind === 'Document', 47);\n var operations = doc.definitions\n .filter(function (d) { return d.kind !== 'FragmentDefinition'; })\n .map(function (definition) {\n if (definition.kind !== 'OperationDefinition') {\n throw __DEV__ ? new InvariantError(\"Schema type definitions not allowed in queries. Found: \\\"\".concat(definition.kind, \"\\\"\")) : new InvariantError(48);\n }\n return definition;\n });\n __DEV__ ? invariant(operations.length <= 1, \"Ambiguous GraphQL document: contains \".concat(operations.length, \" operations\")) : invariant(operations.length <= 1, 49);\n return doc;\n}\nexport function getOperationDefinition(doc) {\n checkDocument(doc);\n return doc.definitions.filter(function (definition) {\n return definition.kind === 'OperationDefinition';\n })[0];\n}\nexport function getOperationName(doc) {\n return (doc.definitions\n .filter(function (definition) {\n return definition.kind === 'OperationDefinition' && !!definition.name;\n })\n .map(function (x) { return x.name.value; })[0] || null);\n}\nexport function getFragmentDefinitions(doc) {\n return doc.definitions.filter(function (definition) {\n return definition.kind === 'FragmentDefinition';\n });\n}\nexport function getQueryDefinition(doc) {\n var queryDef = getOperationDefinition(doc);\n __DEV__ ? invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : invariant(queryDef && queryDef.operation === 'query', 50);\n return queryDef;\n}\nexport function getFragmentDefinition(doc) {\n __DEV__ ? invariant(doc.kind === 'Document', \"Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \\\"gql\\\" tag? http://docs.apollostack.com/apollo-client/core.html#gql\") : invariant(doc.kind === 'Document', 51);\n __DEV__ ? invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : invariant(doc.definitions.length <= 1, 52);\n var fragmentDef = doc.definitions[0];\n __DEV__ ? invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : invariant(fragmentDef.kind === 'FragmentDefinition', 53);\n return fragmentDef;\n}\nexport function getMainDefinition(queryDoc) {\n checkDocument(queryDoc);\n var fragmentDefinition;\n for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) {\n var definition = _a[_i];\n if (definition.kind === 'OperationDefinition') {\n var operation = definition.operation;\n if (operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription') {\n return definition;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n fragmentDefinition = definition;\n }\n }\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n throw __DEV__ ? new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new InvariantError(54);\n}\nexport function getDefaultValues(definition) {\n var defaultValues = Object.create(null);\n var defs = definition && definition.variableDefinitions;\n if (defs && defs.length) {\n defs.forEach(function (def) {\n if (def.defaultValue) {\n valueToObjectRepresentation(defaultValues, def.variable.name, def.defaultValue);\n }\n });\n }\n return defaultValues;\n}\n//# sourceMappingURL=getFromAST.js.map","export var isArray = Array.isArray;\nexport function isNonEmptyArray(value) {\n return Array.isArray(value) && value.length > 0;\n}\n//# sourceMappingURL=arrays.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport { invariant } from \"../globals/index.js\";\nimport { visit, Kind, } from 'graphql';\nimport { checkDocument, getOperationDefinition, getFragmentDefinition, getFragmentDefinitions, getMainDefinition, } from \"./getFromAST.js\";\nimport { isField } from \"./storeUtils.js\";\nimport { createFragmentMap, } from \"./fragments.js\";\nimport { isArray } from \"../common/arrays.js\";\nvar TYPENAME_FIELD = {\n kind: Kind.FIELD,\n name: {\n kind: Kind.NAME,\n value: '__typename',\n },\n};\nfunction isEmpty(op, fragmentMap) {\n return !op || op.selectionSet.selections.every(function (selection) { return selection.kind === Kind.FRAGMENT_SPREAD &&\n isEmpty(fragmentMap[selection.name.value], fragmentMap); });\n}\nfunction nullIfDocIsEmpty(doc) {\n return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))\n ? null\n : doc;\n}\nfunction getDirectiveMatcher(directives) {\n var nameSet = new Set();\n var tests = [];\n directives.forEach(function (directive) {\n if (directive.name) {\n nameSet.add(directive.name);\n }\n else if (directive.test) {\n tests.push(directive.test);\n }\n });\n return function (directive) { return (nameSet.has(directive.name.value) ||\n tests.some(function (test) { return test(directive); })); };\n}\nfunction makeInUseGetterFunction(defaultKey) {\n var map = new Map();\n return function inUseGetterFunction(key) {\n if (key === void 0) { key = defaultKey; }\n var inUse = map.get(key);\n if (!inUse) {\n map.set(key, inUse = {\n variables: new Set,\n fragmentSpreads: new Set,\n });\n }\n return inUse;\n };\n}\nexport function removeDirectivesFromDocument(directives, doc) {\n var getInUseByOperationName = makeInUseGetterFunction(\"\");\n var getInUseByFragmentName = makeInUseGetterFunction(\"\");\n var getInUse = function (ancestors) {\n for (var p = 0, ancestor = void 0; p < ancestors.length && (ancestor = ancestors[p]); ++p) {\n if (isArray(ancestor))\n continue;\n if (ancestor.kind === Kind.OPERATION_DEFINITION) {\n return getInUseByOperationName(ancestor.name && ancestor.name.value);\n }\n if (ancestor.kind === Kind.FRAGMENT_DEFINITION) {\n return getInUseByFragmentName(ancestor.name.value);\n }\n }\n __DEV__ && invariant.error(\"Could not find operation or fragment\");\n return null;\n };\n var operationCount = 0;\n for (var i = doc.definitions.length - 1; i >= 0; --i) {\n if (doc.definitions[i].kind === Kind.OPERATION_DEFINITION) {\n ++operationCount;\n }\n }\n var directiveMatcher = getDirectiveMatcher(directives);\n var hasRemoveDirective = directives.some(function (directive) { return directive.remove; });\n var shouldRemoveField = function (nodeDirectives) { return (hasRemoveDirective &&\n nodeDirectives &&\n nodeDirectives.some(directiveMatcher)); };\n var originalFragmentDefsByPath = new Map();\n var firstVisitMadeChanges = false;\n var fieldOrInlineFragmentVisitor = {\n enter: function (node) {\n if (shouldRemoveField(node.directives)) {\n firstVisitMadeChanges = true;\n return null;\n }\n },\n };\n var docWithoutDirectiveSubtrees = visit(doc, {\n Field: fieldOrInlineFragmentVisitor,\n InlineFragment: fieldOrInlineFragmentVisitor,\n VariableDefinition: {\n enter: function () {\n return false;\n },\n },\n Variable: {\n enter: function (node, _key, _parent, _path, ancestors) {\n var inUse = getInUse(ancestors);\n if (inUse) {\n inUse.variables.add(node.name.value);\n }\n },\n },\n FragmentSpread: {\n enter: function (node, _key, _parent, _path, ancestors) {\n if (shouldRemoveField(node.directives)) {\n firstVisitMadeChanges = true;\n return null;\n }\n var inUse = getInUse(ancestors);\n if (inUse) {\n inUse.fragmentSpreads.add(node.name.value);\n }\n },\n },\n FragmentDefinition: {\n enter: function (node, _key, _parent, path) {\n originalFragmentDefsByPath.set(JSON.stringify(path), node);\n },\n leave: function (node, _key, _parent, path) {\n var originalNode = originalFragmentDefsByPath.get(JSON.stringify(path));\n if (node === originalNode) {\n return node;\n }\n if (operationCount > 0 &&\n node.selectionSet.selections.every(function (selection) { return (selection.kind === Kind.FIELD &&\n selection.name.value === '__typename'); })) {\n getInUseByFragmentName(node.name.value).removed = true;\n firstVisitMadeChanges = true;\n return null;\n }\n },\n },\n Directive: {\n leave: function (node) {\n if (directiveMatcher(node)) {\n firstVisitMadeChanges = true;\n return null;\n }\n },\n },\n });\n if (!firstVisitMadeChanges) {\n return doc;\n }\n var populateTransitiveVars = function (inUse) {\n if (!inUse.transitiveVars) {\n inUse.transitiveVars = new Set(inUse.variables);\n if (!inUse.removed) {\n inUse.fragmentSpreads.forEach(function (childFragmentName) {\n populateTransitiveVars(getInUseByFragmentName(childFragmentName)).transitiveVars.forEach(function (varName) {\n inUse.transitiveVars.add(varName);\n });\n });\n }\n }\n return inUse;\n };\n var allFragmentNamesUsed = new Set();\n docWithoutDirectiveSubtrees.definitions.forEach(function (def) {\n if (def.kind === Kind.OPERATION_DEFINITION) {\n populateTransitiveVars(getInUseByOperationName(def.name && def.name.value)).fragmentSpreads.forEach(function (childFragmentName) {\n allFragmentNamesUsed.add(childFragmentName);\n });\n }\n else if (def.kind === Kind.FRAGMENT_DEFINITION &&\n operationCount === 0 &&\n !getInUseByFragmentName(def.name.value).removed) {\n allFragmentNamesUsed.add(def.name.value);\n }\n });\n allFragmentNamesUsed.forEach(function (fragmentName) {\n populateTransitiveVars(getInUseByFragmentName(fragmentName)).fragmentSpreads.forEach(function (childFragmentName) {\n allFragmentNamesUsed.add(childFragmentName);\n });\n });\n var fragmentWillBeRemoved = function (fragmentName) { return !!(!allFragmentNamesUsed.has(fragmentName) ||\n getInUseByFragmentName(fragmentName).removed); };\n var enterVisitor = {\n enter: function (node) {\n if (fragmentWillBeRemoved(node.name.value)) {\n return null;\n }\n },\n };\n return nullIfDocIsEmpty(visit(docWithoutDirectiveSubtrees, {\n FragmentSpread: enterVisitor,\n FragmentDefinition: enterVisitor,\n OperationDefinition: {\n leave: function (node) {\n if (node.variableDefinitions) {\n var usedVariableNames_1 = populateTransitiveVars(getInUseByOperationName(node.name && node.name.value)).transitiveVars;\n if (usedVariableNames_1.size < node.variableDefinitions.length) {\n return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) { return usedVariableNames_1.has(varDef.variable.name.value); }) });\n }\n }\n },\n },\n }));\n}\nexport var addTypenameToDocument = Object.assign(function (doc) {\n return visit(doc, {\n SelectionSet: {\n enter: function (node, _key, parent) {\n if (parent &&\n parent.kind === Kind.OPERATION_DEFINITION) {\n return;\n }\n var selections = node.selections;\n if (!selections) {\n return;\n }\n var skip = selections.some(function (selection) {\n return (isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0));\n });\n if (skip) {\n return;\n }\n var field = parent;\n if (isField(field) &&\n field.directives &&\n field.directives.some(function (d) { return d.name.value === 'export'; })) {\n return;\n }\n return __assign(__assign({}, node), { selections: __spreadArray(__spreadArray([], selections, true), [TYPENAME_FIELD], false) });\n },\n },\n });\n}, {\n added: function (field) {\n return field === TYPENAME_FIELD;\n },\n});\nvar connectionRemoveConfig = {\n test: function (directive) {\n var willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (!directive.arguments ||\n !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {\n __DEV__ && invariant.warn('Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.');\n }\n }\n return willRemove;\n },\n};\nexport function removeConnectionDirectiveFromDocument(doc) {\n return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc));\n}\nfunction hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) {\n if (nestedCheck === void 0) { nestedCheck = true; }\n return (!!selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(function (selection) {\n return hasDirectivesInSelection(directives, selection, nestedCheck);\n }));\n}\nfunction hasDirectivesInSelection(directives, selection, nestedCheck) {\n if (nestedCheck === void 0) { nestedCheck = true; }\n if (!isField(selection)) {\n return true;\n }\n if (!selection.directives) {\n return false;\n }\n return (selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck)));\n}\nfunction getArgumentMatcher(config) {\n return function argumentMatcher(argument) {\n return config.some(function (aConfig) {\n return argument.value &&\n argument.value.kind === Kind.VARIABLE &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument)));\n });\n };\n}\nexport function removeArgumentsFromDocument(config, doc) {\n var argMatcher = getArgumentMatcher(config);\n return nullIfDocIsEmpty(visit(doc, {\n OperationDefinition: {\n enter: function (node) {\n return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(function (varDef) {\n return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });\n }) : [] });\n },\n },\n Field: {\n enter: function (node) {\n var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; });\n if (shouldRemoveField) {\n var argMatchCount_1 = 0;\n if (node.arguments) {\n node.arguments.forEach(function (arg) {\n if (argMatcher(arg)) {\n argMatchCount_1 += 1;\n }\n });\n }\n if (argMatchCount_1 === 1) {\n return null;\n }\n }\n },\n },\n Argument: {\n enter: function (node) {\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }));\n}\nexport function removeFragmentSpreadFromDocument(config, doc) {\n function enter(node) {\n if (config.some(function (def) { return def.name === node.name.value; })) {\n return null;\n }\n }\n return nullIfDocIsEmpty(visit(doc, {\n FragmentSpread: { enter: enter },\n FragmentDefinition: { enter: enter },\n }));\n}\nexport function buildQueryFromSelectionSet(document) {\n var definition = getMainDefinition(document);\n var definitionOperation = definition.operation;\n if (definitionOperation === 'query') {\n return document;\n }\n var modifiedDoc = visit(document, {\n OperationDefinition: {\n enter: function (node) {\n return __assign(__assign({}, node), { operation: 'query' });\n },\n },\n });\n return modifiedDoc;\n}\nexport function removeClientSetsFromDocument(document) {\n checkDocument(document);\n var modifiedDoc = removeDirectivesFromDocument([\n {\n test: function (directive) { return directive.name.value === 'client'; },\n remove: true,\n },\n ], document);\n return modifiedDoc;\n}\n//# sourceMappingURL=transform.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport { isNonNullObject } from \"./objects.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function mergeDeep() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n return mergeDeepArray(sources);\n}\nexport function mergeDeepArray(sources) {\n var target = sources[0] || {};\n var count = sources.length;\n if (count > 1) {\n var merger = new DeepMerger();\n for (var i = 1; i < count; ++i) {\n target = merger.merge(target, sources[i]);\n }\n }\n return target;\n}\nvar defaultReconciler = function (target, source, property) {\n return this.merge(target[property], source[property]);\n};\nvar DeepMerger = (function () {\n function DeepMerger(reconciler) {\n if (reconciler === void 0) { reconciler = defaultReconciler; }\n this.reconciler = reconciler;\n this.isObject = isNonNullObject;\n this.pastCopies = new Set();\n }\n DeepMerger.prototype.merge = function (target, source) {\n var _this = this;\n var context = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n context[_i - 2] = arguments[_i];\n }\n if (isNonNullObject(source) && isNonNullObject(target)) {\n Object.keys(source).forEach(function (sourceKey) {\n if (hasOwnProperty.call(target, sourceKey)) {\n var targetValue = target[sourceKey];\n if (source[sourceKey] !== targetValue) {\n var result = _this.reconciler.apply(_this, __spreadArray([target, source, sourceKey], context, false));\n if (result !== targetValue) {\n target = _this.shallowCopyForMerge(target);\n target[sourceKey] = result;\n }\n }\n }\n else {\n target = _this.shallowCopyForMerge(target);\n target[sourceKey] = source[sourceKey];\n }\n });\n return target;\n }\n return source;\n };\n DeepMerger.prototype.shallowCopyForMerge = function (value) {\n if (isNonNullObject(value)) {\n if (!this.pastCopies.has(value)) {\n if (Array.isArray(value)) {\n value = value.slice(0);\n }\n else {\n value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);\n }\n this.pastCopies.add(value);\n }\n }\n return value;\n };\n return DeepMerger;\n}());\nexport { DeepMerger };\n//# sourceMappingURL=mergeDeep.js.map","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n// === Symbol Support ===\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\n\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\n\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species'); // === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n if (value == null) return undefined;\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n\n if (ctor === null) {\n ctor = undefined;\n }\n }\n\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n\n if (!queue) {\n return;\n }\n\n subscription._queue = undefined;\n subscription._state = 'ready';\n\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({\n type: type,\n value: value\n });\n\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{\n type: type,\n value: value\n }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription = /*#__PURE__*/function () {\n function Subscription(observer, subscriber) {\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n var _proto = Subscription.prototype;\n\n _proto.unsubscribe = function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n };\n\n _createClass(Subscription, [{\n key: \"closed\",\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver = /*#__PURE__*/function () {\n function SubscriptionObserver(subscription) {\n this._subscription = subscription;\n }\n\n var _proto2 = SubscriptionObserver.prototype;\n\n _proto2.next = function next(value) {\n onNotify(this._subscription, 'next', value);\n };\n\n _proto2.error = function error(value) {\n onNotify(this._subscription, 'error', value);\n };\n\n _proto2.complete = function complete() {\n onNotify(this._subscription, 'complete');\n };\n\n _createClass(SubscriptionObserver, [{\n key: \"closed\",\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable = /*#__PURE__*/function () {\n function Observable(subscriber) {\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n this._subscriber = subscriber;\n }\n\n var _proto3 = Observable.prototype;\n\n _proto3.subscribe = function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n\n return new Subscription(observer, this._subscriber);\n };\n\n _proto3.forEach = function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n };\n\n _proto3.map = function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n };\n\n _proto3.filter = function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n };\n\n _proto3.reduce = function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n observer.next(acc);\n observer.complete();\n }\n });\n });\n };\n\n _proto3.concat = function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscription;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n };\n\n _proto3.flatMap = function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n };\n\n _proto3[SymbolObservable] = function () {\n return this;\n };\n\n Observable.from = function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n if (x == null) throw new TypeError(x + ' is not an object');\n var method = getMethod(x, SymbolObservable);\n\n if (method) {\n var observable = method.call(x);\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n if (isObservable(observable) && observable.constructor === C) return observable;\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var _iterator = _createForOfIteratorHelperLoose(method.call(x)), _step; !(_step = _iterator()).done;) {\n var item = _step.value;\n observer.next(item);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n };\n\n Observable.of = function of() {\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n };\n\n _createClass(Observable, null, [{\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}\n\nexport { Observable };\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\n\t\t\tif (typeof Symbol.for === 'function') {\n\t\t\t\t// This just needs to be something that won't trample other user's Symbol.for use\n\t\t\t\t// It also will guide people to the source of their issues, if this is problematic.\n\t\t\t\t// META: It's a resource locator!\n\t\t\t\tresult = Symbol.for('https://github.com/benlesh/symbol-observable');\n\t\t\t} else {\n\t\t\t\t// Symbol.for didn't exist! The best we can do at this point is a totally \n\t\t\t\t// unique symbol. Note that the string argument here is a descriptor, not\n\t\t\t\t// an identifier. This symbol is unique.\n\t\t\t\tresult = Symbol('https://github.com/benlesh/symbol-observable');\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tSymbol.observable = result;\n\t\t\t} catch (err) {\n\t\t\t\t// Do nothing. In some environments, users have frozen `Symbol` for security reasons,\n\t\t\t\t// if it is frozen assigning to it will throw. In this case, we don't care, because\n\t\t\t\t// they will need to use the returned value from the ponyfill.\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","import { Observable, } from 'zen-observable-ts';\nimport 'symbol-observable';\nvar prototype = Observable.prototype;\nvar fakeObsSymbol = '@@observable';\nif (!prototype[fakeObsSymbol]) {\n prototype[fakeObsSymbol] = function () { return this; };\n}\nexport { Observable };\n//# sourceMappingURL=Observable.js.map","var toString = Object.prototype.toString;\nexport function cloneDeep(value) {\n return cloneDeepHelper(value);\n}\nfunction cloneDeepHelper(val, seen) {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n seen = seen || new Map;\n if (seen.has(val))\n return seen.get(val);\n var copy_1 = val.slice(0);\n seen.set(val, copy_1);\n copy_1.forEach(function (child, i) {\n copy_1[i] = cloneDeepHelper(child, seen);\n });\n return copy_1;\n }\n case \"[object Object]\": {\n seen = seen || new Map;\n if (seen.has(val))\n return seen.get(val);\n var copy_2 = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy_2);\n Object.keys(val).forEach(function (key) {\n copy_2[key] = cloneDeepHelper(val[key], seen);\n });\n return copy_2;\n }\n default:\n return val;\n }\n}\n//# sourceMappingURL=cloneDeep.js.map","import \"../globals/index.js\";\nimport { isNonNullObject } from \"./objects.js\";\nfunction deepFreeze(value) {\n var workSet = new Set([value]);\n workSet.forEach(function (obj) {\n if (isNonNullObject(obj) && shallowFreeze(obj) === obj) {\n Object.getOwnPropertyNames(obj).forEach(function (name) {\n if (isNonNullObject(obj[name]))\n workSet.add(obj[name]);\n });\n }\n });\n return value;\n}\nfunction shallowFreeze(obj) {\n if (__DEV__ && !Object.isFrozen(obj)) {\n try {\n Object.freeze(obj);\n }\n catch (e) {\n if (e instanceof TypeError)\n return null;\n throw e;\n }\n }\n return obj;\n}\nexport function maybeDeepFreeze(obj) {\n if (__DEV__) {\n deepFreeze(obj);\n }\n return obj;\n}\n//# sourceMappingURL=maybeDeepFreeze.js.map","export function iterateObserversSafely(observers, method, argument) {\n var observersWithMethod = [];\n observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); });\n observersWithMethod.forEach(function (obs) { return obs[method](argument); });\n}\n//# sourceMappingURL=iteration.js.map","import { Observable } from \"./Observable.js\";\nexport function asyncMap(observable, mapFn, catchFn) {\n return new Observable(function (observer) {\n var next = observer.next, error = observer.error, complete = observer.complete;\n var activeCallbackCount = 0;\n var completed = false;\n var promiseQueue = {\n then: function (callback) {\n return new Promise(function (resolve) { return resolve(callback()); });\n },\n };\n function makeCallback(examiner, delegate) {\n if (examiner) {\n return function (arg) {\n ++activeCallbackCount;\n var both = function () { return examiner(arg); };\n promiseQueue = promiseQueue.then(both, both).then(function (result) {\n --activeCallbackCount;\n next && next.call(observer, result);\n if (completed) {\n handler.complete();\n }\n }, function (error) {\n --activeCallbackCount;\n throw error;\n }).catch(function (caught) {\n error && error.call(observer, caught);\n });\n };\n }\n else {\n return function (arg) { return delegate && delegate.call(observer, arg); };\n }\n }\n var handler = {\n next: makeCallback(mapFn, next),\n error: makeCallback(catchFn, error),\n complete: function () {\n completed = true;\n if (!activeCallbackCount) {\n complete && complete.call(observer);\n }\n },\n };\n var sub = observable.subscribe(handler);\n return function () { return sub.unsubscribe(); };\n });\n}\n//# sourceMappingURL=asyncMap.js.map","import { maybe } from \"../globals/index.js\";\nexport var canUseWeakMap = typeof WeakMap === 'function' &&\n maybe(function () { return navigator.product; }) !== 'ReactNative';\nexport var canUseWeakSet = typeof WeakSet === 'function';\nexport var canUseSymbol = typeof Symbol === 'function' &&\n typeof Symbol.for === 'function';\nexport var canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;\nexport var canUseDOM = typeof maybe(function () { return window.document.createElement; }) === \"function\";\nvar usingJSDOM = maybe(function () { return navigator.userAgent.indexOf(\"jsdom\") >= 0; }) || false;\nexport var canUseLayoutEffect = canUseDOM && !usingJSDOM;\n//# sourceMappingURL=canUse.js.map","import { Observable } from \"./Observable.js\";\nimport { canUseSymbol } from \"../common/canUse.js\";\nexport function fixObservableSubclass(subclass) {\n function set(key) {\n Object.defineProperty(subclass, key, { value: Observable });\n }\n if (canUseSymbol && Symbol.species) {\n set(Symbol.species);\n }\n set(\"@@species\");\n return subclass;\n}\n//# sourceMappingURL=subclassing.js.map","import { __extends } from \"tslib\";\nimport { Observable } from \"./Observable.js\";\nimport { iterateObserversSafely } from \"./iteration.js\";\nimport { fixObservableSubclass } from \"./subclassing.js\";\nfunction isPromiseLike(value) {\n return value && typeof value.then === \"function\";\n}\nvar Concast = (function (_super) {\n __extends(Concast, _super);\n function Concast(sources) {\n var _this = _super.call(this, function (observer) {\n _this.addObserver(observer);\n return function () { return _this.removeObserver(observer); };\n }) || this;\n _this.observers = new Set();\n _this.promise = new Promise(function (resolve, reject) {\n _this.resolve = resolve;\n _this.reject = reject;\n });\n _this.handlers = {\n next: function (result) {\n if (_this.sub !== null) {\n _this.latest = [\"next\", result];\n _this.notify(\"next\", result);\n iterateObserversSafely(_this.observers, \"next\", result);\n }\n },\n error: function (error) {\n var sub = _this.sub;\n if (sub !== null) {\n if (sub)\n setTimeout(function () { return sub.unsubscribe(); });\n _this.sub = null;\n _this.latest = [\"error\", error];\n _this.reject(error);\n _this.notify(\"error\", error);\n iterateObserversSafely(_this.observers, \"error\", error);\n }\n },\n complete: function () {\n var _a = _this, sub = _a.sub, _b = _a.sources, sources = _b === void 0 ? [] : _b;\n if (sub !== null) {\n var value = sources.shift();\n if (!value) {\n if (sub)\n setTimeout(function () { return sub.unsubscribe(); });\n _this.sub = null;\n if (_this.latest &&\n _this.latest[0] === \"next\") {\n _this.resolve(_this.latest[1]);\n }\n else {\n _this.resolve();\n }\n _this.notify(\"complete\");\n iterateObserversSafely(_this.observers, \"complete\");\n }\n else if (isPromiseLike(value)) {\n value.then(function (obs) { return _this.sub = obs.subscribe(_this.handlers); });\n }\n else {\n _this.sub = value.subscribe(_this.handlers);\n }\n }\n },\n };\n _this.nextResultListeners = new Set();\n _this.cancel = function (reason) {\n _this.reject(reason);\n _this.sources = [];\n _this.handlers.complete();\n };\n _this.promise.catch(function (_) { });\n if (typeof sources === \"function\") {\n sources = [new Observable(sources)];\n }\n if (isPromiseLike(sources)) {\n sources.then(function (iterable) { return _this.start(iterable); }, _this.handlers.error);\n }\n else {\n _this.start(sources);\n }\n return _this;\n }\n Concast.prototype.start = function (sources) {\n if (this.sub !== void 0)\n return;\n this.sources = Array.from(sources);\n this.handlers.complete();\n };\n Concast.prototype.deliverLastMessage = function (observer) {\n if (this.latest) {\n var nextOrError = this.latest[0];\n var method = observer[nextOrError];\n if (method) {\n method.call(observer, this.latest[1]);\n }\n if (this.sub === null &&\n nextOrError === \"next\" &&\n observer.complete) {\n observer.complete();\n }\n }\n };\n Concast.prototype.addObserver = function (observer) {\n if (!this.observers.has(observer)) {\n this.deliverLastMessage(observer);\n this.observers.add(observer);\n }\n };\n Concast.prototype.removeObserver = function (observer) {\n if (this.observers.delete(observer) &&\n this.observers.size < 1) {\n this.handlers.complete();\n }\n };\n Concast.prototype.notify = function (method, arg) {\n var nextResultListeners = this.nextResultListeners;\n if (nextResultListeners.size) {\n this.nextResultListeners = new Set;\n nextResultListeners.forEach(function (listener) { return listener(method, arg); });\n }\n };\n Concast.prototype.beforeNext = function (callback) {\n var called = false;\n this.nextResultListeners.add(function (method, arg) {\n if (!called) {\n called = true;\n callback(method, arg);\n }\n });\n };\n return Concast;\n}(Observable));\nexport { Concast };\nfixObservableSubclass(Concast);\n//# sourceMappingURL=Concast.js.map","import { isNonNullObject } from \"./objects.js\";\nimport { isNonEmptyArray } from \"./arrays.js\";\nimport { DeepMerger } from \"./mergeDeep.js\";\nexport function isExecutionPatchIncrementalResult(value) {\n return \"incremental\" in value;\n}\nexport function isExecutionPatchInitialResult(value) {\n return \"hasNext\" in value && \"data\" in value;\n}\nexport function isExecutionPatchResult(value) {\n return (isExecutionPatchIncrementalResult(value) ||\n isExecutionPatchInitialResult(value));\n}\nexport function isApolloPayloadResult(value) {\n return isNonNullObject(value) && \"payload\" in value;\n}\nexport function mergeIncrementalData(prevResult, result) {\n var mergedData = prevResult;\n var merger = new DeepMerger();\n if (isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)) {\n result.incremental.forEach(function (_a) {\n var data = _a.data, path = _a.path;\n for (var i = path.length - 1; i >= 0; --i) {\n var key = path[i];\n var isNumericKey = !isNaN(+key);\n var parent_1 = isNumericKey ? [] : {};\n parent_1[key] = data;\n data = parent_1;\n }\n mergedData = merger.merge(mergedData, data);\n });\n }\n return mergedData;\n}\n//# sourceMappingURL=incrementalResult.js.map","import { isNonEmptyArray } from \"./arrays.js\";\nimport { isExecutionPatchIncrementalResult } from \"./incrementalResult.js\";\nexport function graphQLResultHasError(result) {\n var errors = getGraphQLErrorsFromResult(result);\n return isNonEmptyArray(errors);\n}\nexport function getGraphQLErrorsFromResult(result) {\n var graphQLErrors = isNonEmptyArray(result.errors)\n ? result.errors.slice(0)\n : [];\n if (isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)) {\n result.incremental.forEach(function (incrementalResult) {\n if (incrementalResult.errors) {\n graphQLErrors.push.apply(graphQLErrors, incrementalResult.errors);\n }\n });\n }\n return graphQLErrors;\n}\n//# sourceMappingURL=errorHandling.js.map","export function compact() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n var result = Object.create(null);\n objects.forEach(function (obj) {\n if (!obj)\n return;\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n if (value !== void 0) {\n result[key] = value;\n }\n });\n });\n return result;\n}\n//# sourceMappingURL=compact.js.map","var prefixCounts = new Map();\nexport function makeUniqueId(prefix) {\n var count = prefixCounts.get(prefix) || 1;\n prefixCounts.set(prefix, count + 1);\n return \"\".concat(prefix, \":\").concat(count, \":\").concat(Math.random().toString(36).slice(2));\n}\n//# sourceMappingURL=makeUniqueId.js.map","import { makeUniqueId } from \"./makeUniqueId.js\";\nexport function stringifyForDisplay(value) {\n var undefId = makeUniqueId(\"stringifyForDisplay\");\n return JSON.stringify(value, function (key, value) {\n return value === void 0 ? undefId : value;\n }).split(JSON.stringify(undefId)).join(\"\");\n}\n//# sourceMappingURL=stringifyForDisplay.js.map","import { __assign } from \"tslib\";\nimport { compact } from \"./compact.js\";\nexport function mergeOptions(defaults, options) {\n return compact(defaults, options, options.variables && {\n variables: __assign(__assign({}, (defaults && defaults.variables)), options.variables),\n });\n}\n//# sourceMappingURL=mergeOptions.js.map","import { Observable } from \"../../utilities/index.js\";\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","export var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n//# sourceMappingURL=throwServerError.js.map","import { InvariantError } from \"../../utilities/globals/index.js\";\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw __DEV__ ? new InvariantError(\"illegal argument: \".concat(key)) : new InvariantError(27);\n }\n }\n return operation;\n}\n//# sourceMappingURL=validateOperation.js.map","import { __assign } from \"tslib\";\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign(__assign({}, context), next(context));\n }\n else {\n context = __assign(__assign({}, context), next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map","import { getOperationName } from \"../../utilities/index.js\";\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n return transformedOperation;\n}\n//# sourceMappingURL=transformOperation.js.map","import { __extends } from \"tslib\";\nimport { InvariantError, invariant } from \"../../utilities/globals/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport { validateOperation, createOperation, transformOperation, } from \"../utils/index.js\";\nfunction passthrough(op, forward) {\n return (forward ? forward(op) : Observable.of());\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nvar LinkError = (function (_super) {\n __extends(LinkError, _super);\n function LinkError(message, link) {\n var _this = _super.call(this, message) || this;\n _this.link = link;\n return _this;\n }\n return LinkError;\n}(Error));\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.empty = function () {\n return new ApolloLink(function () { return Observable.of(); });\n };\n ApolloLink.from = function (links) {\n if (links.length === 0)\n return ApolloLink.empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n };\n ApolloLink.split = function (test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n };\n ApolloLink.execute = function (link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n };\n ApolloLink.concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n __DEV__ && invariant.warn(new LinkError(\"You are calling concat on a terminating link, which will have no effect\", firstLink));\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n };\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return ApolloLink.concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw __DEV__ ? new InvariantError('request is not implemented') : new InvariantError(22);\n };\n ApolloLink.prototype.onError = function (error, observer) {\n if (observer && observer.error) {\n observer.error(error);\n return false;\n }\n throw error;\n };\n ApolloLink.prototype.setOnError = function (fn) {\n this.onError = fn;\n return this;\n };\n return ApolloLink;\n}());\nexport { ApolloLink };\n//# sourceMappingURL=ApolloLink.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var split = ApolloLink.split;\n//# sourceMappingURL=split.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var execute = ApolloLink.execute;\n//# sourceMappingURL=execute.js.map","export var version = '3.7.17';\n//# sourceMappingURL=version.js.map","import { canUseAsyncIteratorSymbol } from \"./canUse.js\";\nexport function isNodeResponse(value) {\n return !!value.body;\n}\nexport function isReadableStream(value) {\n return !!value.getReader;\n}\nexport function isAsyncIterableIterator(value) {\n return !!(canUseAsyncIteratorSymbol &&\n value[Symbol.asyncIterator]);\n}\nexport function isStreamableBlob(value) {\n return !!value.stream;\n}\nexport function isBlob(value) {\n return !!value.arrayBuffer;\n}\nexport function isNodeReadableStream(value) {\n return !!value.pipe;\n}\n//# sourceMappingURL=responseIterator.js.map","export default function asyncIterator(source) {\n var _a;\n var iterator = source[Symbol.asyncIterator]();\n return _a = {\n next: function () {\n return iterator.next();\n }\n },\n _a[Symbol.asyncIterator] = function () {\n return this;\n },\n _a;\n}\n//# sourceMappingURL=async.js.map","import { canUseAsyncIteratorSymbol } from \"../../../utilities/index.js\";\nexport default function nodeStreamIterator(stream) {\n var cleanup = null;\n var error = null;\n var done = false;\n var data = [];\n var waiting = [];\n function onData(chunk) {\n if (error)\n return;\n if (waiting.length) {\n var shiftedArr = waiting.shift();\n if (Array.isArray(shiftedArr) && shiftedArr[0]) {\n return shiftedArr[0]({ value: chunk, done: false });\n }\n }\n data.push(chunk);\n }\n function onError(err) {\n error = err;\n var all = waiting.slice();\n all.forEach(function (pair) {\n pair[1](err);\n });\n !cleanup || cleanup();\n }\n function onEnd() {\n done = true;\n var all = waiting.slice();\n all.forEach(function (pair) {\n pair[0]({ value: undefined, done: true });\n });\n !cleanup || cleanup();\n }\n cleanup = function () {\n cleanup = null;\n stream.removeListener(\"data\", onData);\n stream.removeListener(\"error\", onError);\n stream.removeListener(\"end\", onEnd);\n stream.removeListener(\"finish\", onEnd);\n stream.removeListener(\"close\", onEnd);\n };\n stream.on(\"data\", onData);\n stream.on(\"error\", onError);\n stream.on(\"end\", onEnd);\n stream.on(\"finish\", onEnd);\n stream.on(\"close\", onEnd);\n function getNext() {\n return new Promise(function (resolve, reject) {\n if (error)\n return reject(error);\n if (data.length)\n return resolve({ value: data.shift(), done: false });\n if (done)\n return resolve({ value: undefined, done: true });\n waiting.push([resolve, reject]);\n });\n }\n var iterator = {\n next: function () {\n return getNext();\n },\n };\n if (canUseAsyncIteratorSymbol) {\n iterator[Symbol.asyncIterator] = function () {\n return this;\n };\n }\n return iterator;\n}\n//# sourceMappingURL=nodeStream.js.map","import { canUseAsyncIteratorSymbol } from \"../../../utilities/index.js\";\nexport default function promiseIterator(promise) {\n var resolved = false;\n var iterator = {\n next: function () {\n if (resolved)\n return Promise.resolve({\n value: undefined,\n done: true,\n });\n resolved = true;\n return new Promise(function (resolve, reject) {\n promise\n .then(function (value) {\n resolve({ value: value, done: false });\n })\n .catch(reject);\n });\n },\n };\n if (canUseAsyncIteratorSymbol) {\n iterator[Symbol.asyncIterator] = function () {\n return this;\n };\n }\n return iterator;\n}\n//# sourceMappingURL=promise.js.map","import { canUseAsyncIteratorSymbol } from \"../../../utilities/index.js\";\nexport default function readerIterator(reader) {\n var iterator = {\n next: function () {\n return reader.read();\n },\n };\n if (canUseAsyncIteratorSymbol) {\n iterator[Symbol.asyncIterator] = function () {\n return this;\n };\n }\n return iterator;\n}\n//# sourceMappingURL=reader.js.map","import { isAsyncIterableIterator, isBlob, isNodeResponse, isNodeReadableStream, isReadableStream, isStreamableBlob, } from \"../../utilities/common/responseIterator.js\";\nimport asyncIterator from \"./iterators/async.js\";\nimport nodeStreamIterator from \"./iterators/nodeStream.js\";\nimport promiseIterator from \"./iterators/promise.js\";\nimport readerIterator from \"./iterators/reader.js\";\nexport function responseIterator(response) {\n var body = response;\n if (isNodeResponse(response))\n body = response.body;\n if (isAsyncIterableIterator(body))\n return asyncIterator(body);\n if (isReadableStream(body))\n return readerIterator(body.getReader());\n if (isStreamableBlob(body)) {\n return readerIterator(body.stream().getReader());\n }\n if (isBlob(body))\n return promiseIterator(body.arrayBuffer());\n if (isNodeReadableStream(body))\n return nodeStreamIterator(body);\n throw new Error(\"Unknown body type for responseIterator. Please pass a streamable response.\");\n}\n//# sourceMappingURL=responseIterator.js.map","import { __extends, __spreadArray } from \"tslib\";\nimport \"../utilities/globals/index.js\";\nimport { isNonNullObject } from \"../utilities/index.js\";\nexport var PROTOCOL_ERRORS_SYMBOL = Symbol();\nexport function graphQLResultHasProtocolErrors(result) {\n if (result.extensions) {\n return Array.isArray(result.extensions[PROTOCOL_ERRORS_SYMBOL]);\n }\n return false;\n}\nexport function isApolloError(err) {\n return err.hasOwnProperty('graphQLErrors');\n}\nvar generateErrorMessage = function (err) {\n var errors = __spreadArray(__spreadArray(__spreadArray([], err.graphQLErrors, true), err.clientErrors, true), err.protocolErrors, true);\n if (err.networkError)\n errors.push(err.networkError);\n return errors\n .map(function (err) { return isNonNullObject(err) && err.message || 'Error message not found.'; })\n .join('\\n');\n};\nvar ApolloError = (function (_super) {\n __extends(ApolloError, _super);\n function ApolloError(_a) {\n var graphQLErrors = _a.graphQLErrors, protocolErrors = _a.protocolErrors, clientErrors = _a.clientErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;\n var _this = _super.call(this, errorMessage) || this;\n _this.name = 'ApolloError';\n _this.graphQLErrors = graphQLErrors || [];\n _this.protocolErrors = protocolErrors || [];\n _this.clientErrors = clientErrors || [];\n _this.networkError = networkError || null;\n _this.message = errorMessage || generateErrorMessage(_this);\n _this.extraInfo = extraInfo;\n _this.__proto__ = ApolloError.prototype;\n return _this;\n }\n return ApolloError;\n}(Error));\nexport { ApolloError };\n//# sourceMappingURL=index.js.map","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { responseIterator } from \"./responseIterator.js\";\nimport { throwServerError } from \"../utils/index.js\";\nimport { PROTOCOL_ERRORS_SYMBOL } from \"../../errors/index.js\";\nimport { isApolloPayloadResult } from \"../../utilities/common/incrementalResult.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function readMultipartBody(response, observer) {\n var _a, _b, _c, _d, _e;\n return __awaiter(this, void 0, void 0, function () {\n var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _f, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;\n var _g, _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n if (TextDecoder === undefined) {\n throw new Error(\"TextDecoder must be defined in the environment: please import a polyfill.\");\n }\n decoder = new TextDecoder(\"utf-8\");\n contentType = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get(\"content-type\");\n delimiter = \"boundary=\";\n boundaryVal = (contentType === null || contentType === void 0 ? void 0 : contentType.includes(delimiter))\n ? contentType === null || contentType === void 0 ? void 0 : contentType.substring((contentType === null || contentType === void 0 ? void 0 : contentType.indexOf(delimiter)) + delimiter.length).replace(/['\"]/g, \"\").replace(/\\;(.*)/gm, \"\").trim()\n : \"-\";\n boundary = \"\\r\\n--\".concat(boundaryVal);\n buffer = \"\";\n iterator = responseIterator(response);\n running = true;\n _j.label = 1;\n case 1:\n if (!running) return [3, 3];\n return [4, iterator.next()];\n case 2:\n _f = _j.sent(), value = _f.value, done = _f.done;\n chunk = typeof value === \"string\" ? value : decoder.decode(value);\n searchFrom = buffer.length - boundary.length + 1;\n running = !done;\n buffer += chunk;\n bi = buffer.indexOf(boundary, searchFrom);\n while (bi > -1) {\n message = void 0;\n _g = [\n buffer.slice(0, bi),\n buffer.slice(bi + boundary.length),\n ], message = _g[0], buffer = _g[1];\n i = message.indexOf(\"\\r\\n\\r\\n\");\n headers = parseHeaders(message.slice(0, i));\n contentType_1 = headers[\"content-type\"];\n if (contentType_1 &&\n contentType_1.toLowerCase().indexOf(\"application/json\") === -1) {\n throw new Error(\"Unsupported patch content type: application/json is required.\");\n }\n body = message.slice(i);\n if (body) {\n try {\n result = parseJsonBody(response, body);\n if (Object.keys(result).length > 1 ||\n \"data\" in result ||\n \"incremental\" in result ||\n \"errors\" in result ||\n \"payload\" in result) {\n if (isApolloPayloadResult(result)) {\n next = {};\n if (\"payload\" in result) {\n next = __assign({}, result.payload);\n }\n if (\"errors\" in result) {\n next = __assign(__assign({}, next), { extensions: __assign(__assign({}, (\"extensions\" in next ? next.extensions : null)), (_h = {}, _h[PROTOCOL_ERRORS_SYMBOL] = result.errors, _h)) });\n }\n (_b = observer.next) === null || _b === void 0 ? void 0 : _b.call(observer, next);\n }\n else {\n (_c = observer.next) === null || _c === void 0 ? void 0 : _c.call(observer, result);\n }\n }\n else if (Object.keys(result).length === 1 &&\n \"hasNext\" in result &&\n !result.hasNext) {\n (_d = observer.complete) === null || _d === void 0 ? void 0 : _d.call(observer);\n }\n }\n catch (err) {\n handleError(err, observer);\n }\n }\n bi = buffer.indexOf(boundary);\n }\n return [3, 1];\n case 3:\n (_e = observer.complete) === null || _e === void 0 ? void 0 : _e.call(observer);\n return [2];\n }\n });\n });\n}\nexport function parseHeaders(headerText) {\n var headersInit = {};\n headerText.split(\"\\n\").forEach(function (line) {\n var i = line.indexOf(\":\");\n if (i > -1) {\n var name_1 = line.slice(0, i).trim().toLowerCase();\n var value = line.slice(i + 1).trim();\n headersInit[name_1] = value;\n }\n });\n return headersInit;\n}\nexport function parseJsonBody(response, bodyText) {\n if (response.status >= 300) {\n var getResult = function () {\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n return bodyText;\n }\n };\n throwServerError(response, getResult(), \"Response not successful: Received status code \".concat(response.status));\n }\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n var parseError = err;\n parseError.name = \"ServerParseError\";\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n}\nexport function handleError(err, observer) {\n var _a, _b;\n if (err.name === \"AbortError\")\n return;\n if (err.result && err.result.errors && err.result.data) {\n (_a = observer.next) === null || _a === void 0 ? void 0 : _a.call(observer, err.result);\n }\n (_b = observer.error) === null || _b === void 0 ? void 0 : _b.call(observer, err);\n}\nexport function readJsonBody(response, operation, observer) {\n parseAndCheckHttpResponse(operation)(response)\n .then(function (result) {\n var _a, _b;\n (_a = observer.next) === null || _a === void 0 ? void 0 : _a.call(observer, result);\n (_b = observer.complete) === null || _b === void 0 ? void 0 : _b.call(observer);\n })\n .catch(function (err) { return handleError(err, observer); });\n}\nexport function parseAndCheckHttpResponse(operations) {\n return function (response) {\n return response\n .text()\n .then(function (bodyText) { return parseJsonBody(response, bodyText); })\n .then(function (result) {\n if (response.status >= 300) {\n throwServerError(response, result, \"Response not successful: Received status code \".concat(response.status));\n }\n if (!Array.isArray(result) &&\n !hasOwnProperty.call(result, \"data\") &&\n !hasOwnProperty.call(result, \"errors\")) {\n throwServerError(response, result, \"Server response was missing for query '\".concat(Array.isArray(operations)\n ? operations.map(function (op) { return op.operationName; })\n : operations.operationName, \"'.\"));\n }\n return result;\n });\n };\n}\n//# sourceMappingURL=parseAndCheckHttpResponse.js.map","import { InvariantError } from \"../../utilities/globals/index.js\";\nexport var serializeFetchParameter = function (p, label) {\n var serialized;\n try {\n serialized = JSON.stringify(p);\n }\n catch (e) {\n var parseError = __DEV__ ? new InvariantError(\"Network request failed. \".concat(label, \" is not serializable: \").concat(e.message)) : new InvariantError(24);\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n//# sourceMappingURL=serializeFetchParameter.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport { print } from 'graphql';\n;\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false,\n preserveHeaderCase: false,\n};\nvar defaultHeaders = {\n accept: '*/*',\n 'content-type': 'application/json',\n};\nvar defaultOptions = {\n method: 'POST',\n};\nexport var fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\nexport var defaultPrinter = function (ast, printer) { return printer(ast); };\nexport function selectHttpOptionsAndBody(operation, fallbackConfig) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n configs.unshift(fallbackConfig);\n return selectHttpOptionsAndBodyInternal.apply(void 0, __spreadArray([operation,\n defaultPrinter], configs, false));\n}\nexport function selectHttpOptionsAndBodyInternal(operation, printer) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n var options = {};\n var http = {};\n configs.forEach(function (config) {\n options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), config.headers) });\n if (config.credentials) {\n options.credentials = config.credentials;\n }\n http = __assign(__assign({}, http), config.http);\n });\n if (options.headers) {\n options.headers = removeDuplicateHeaders(options.headers, http.preserveHeaderCase);\n }\n var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;\n var body = { operationName: operationName, variables: variables };\n if (http.includeExtensions)\n body.extensions = extensions;\n if (http.includeQuery)\n body.query = printer(query, print);\n return {\n options: options,\n body: body,\n };\n}\n;\nfunction removeDuplicateHeaders(headers, preserveHeaderCase) {\n if (!preserveHeaderCase) {\n var normalizedHeaders_1 = Object.create(null);\n Object.keys(Object(headers)).forEach(function (name) {\n normalizedHeaders_1[name.toLowerCase()] = headers[name];\n });\n return normalizedHeaders_1;\n }\n var headerData = Object.create(null);\n Object.keys(Object(headers)).forEach(function (name) {\n headerData[name.toLowerCase()] = { originalName: name, value: headers[name] };\n });\n var normalizedHeaders = Object.create(null);\n Object.keys(headerData).forEach(function (name) {\n normalizedHeaders[headerData[name].originalName] = headerData[name].value;\n });\n return normalizedHeaders;\n}\n//# sourceMappingURL=selectHttpOptionsAndBody.js.map","import { InvariantError } from \"../../utilities/globals/index.js\";\nexport var checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n throw __DEV__ ? new InvariantError(\"\\n\\\"fetch\\\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\\n\\nimport fetch from 'cross-fetch';\\nimport { ApolloClient, HttpLink } from '@apollo/client';\\nconst client = new ApolloClient({\\n link: new HttpLink({ uri: '/graphql', fetch })\\n});\\n \") : new InvariantError(23);\n }\n};\n//# sourceMappingURL=checkFetcher.js.map","export var createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n var controller = new AbortController();\n var signal = controller.signal;\n return { controller: controller, signal: signal };\n};\n//# sourceMappingURL=createSignalIfSupported.js.map","export var selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n if (contextURI) {\n return contextURI;\n }\n else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n }\n else {\n return fallbackURI || '/graphql';\n }\n};\n//# sourceMappingURL=selectURI.js.map","import { serializeFetchParameter } from \"./serializeFetchParameter.js\";\nexport function rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(\"\".concat(key, \"=\").concat(encodeURIComponent(value)));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\n//# sourceMappingURL=rewriteURIForGET.js.map","import { __assign, __rest } from \"tslib\";\nimport \"../../utilities/globals/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport { visit } from 'graphql';\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable, hasDirectives } from \"../../utilities/index.js\";\nimport { serializeFetchParameter } from \"./serializeFetchParameter.js\";\nimport { selectURI } from \"./selectURI.js\";\nimport { handleError, readMultipartBody, readJsonBody } from \"./parseAndCheckHttpResponse.js\";\nimport { checkFetcher } from \"./checkFetcher.js\";\nimport { selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig } from \"./selectHttpOptionsAndBody.js\";\nimport { createSignalIfSupported } from \"./createSignalIfSupported.js\";\nimport { rewriteURIForGET } from \"./rewriteURIForGET.js\";\nimport { fromError } from \"../utils/index.js\";\nimport { maybe, getMainDefinition } from \"../../utilities/index.js\";\nvar backupFetch = maybe(function () { return fetch; });\nexport var createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, preferredFetch = linkOptions.fetch, _b = linkOptions.print, print = _b === void 0 ? defaultPrinter : _b, includeExtensions = linkOptions.includeExtensions, preserveHeaderCase = linkOptions.preserveHeaderCase, useGETForQueries = linkOptions.useGETForQueries, _c = linkOptions.includeUnusedVariables, includeUnusedVariables = _c === void 0 ? false : _c, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"print\", \"includeExtensions\", \"preserveHeaderCase\", \"useGETForQueries\", \"includeUnusedVariables\"]);\n if (__DEV__) {\n checkFetcher(preferredFetch || backupFetch);\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions, preserveHeaderCase: preserveHeaderCase },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBodyInternal(operation, print, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n if (body.variables && !includeUnusedVariables) {\n var unusedNames_1 = new Set(Object.keys(body.variables));\n visit(operation.query, {\n Variable: function (node, _key, parent) {\n if (parent && parent.kind !== 'VariableDefinition') {\n unusedNames_1.delete(node.name.value);\n }\n },\n });\n if (unusedNames_1.size) {\n body.variables = __assign({}, body.variables);\n unusedNames_1.forEach(function (name) {\n delete body.variables[name];\n });\n }\n }\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n var definitionIsSubscription = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'subscription';\n };\n var isSubscription = definitionIsSubscription(getMainDefinition(operation.query));\n var hasDefer = hasDirectives(['defer'], operation.query);\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (hasDefer || isSubscription) {\n options.headers = options.headers || {};\n var acceptHeader = \"multipart/mixed;\";\n if (isSubscription && hasDefer) {\n __DEV__ && invariant.warn(\"Multipart-subscriptions do not support @defer\");\n }\n if (isSubscription) {\n acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';\n }\n else if (hasDefer) {\n acceptHeader += 'deferSpec=20220824,application/json';\n }\n options.headers.accept = acceptHeader;\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n var currentFetch = preferredFetch || maybe(function () { return fetch; }) || backupFetch;\n currentFetch(chosenURI, options)\n .then(function (response) {\n var _a;\n operation.setContext({ response: response });\n var ctype = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get('content-type');\n if (ctype !== null && /^multipart\\/mixed/i.test(ctype)) {\n return readMultipartBody(response, observer);\n }\n else {\n return readJsonBody(response, operation, observer);\n }\n })\n .catch(function (err) { return handleError(err, observer); });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\n//# sourceMappingURL=createHttpLink.js.map","import { __extends } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { createHttpLink } from \"./createHttpLink.js\";\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, createHttpLink(options).request) || this;\n _this.options = options;\n return _this;\n }\n return HttpLink;\n}(ApolloLink));\nexport { HttpLink };\n//# sourceMappingURL=HttpLink.js.map","const { toString, hasOwnProperty } = Object.prototype;\nconst fnToStr = Function.prototype.toString;\nconst previousComparisons = new Map();\n/**\n * Performs a deep equality check on two JavaScript values, tolerating cycles.\n */\nexport function equal(a, b) {\n try {\n return check(a, b);\n }\n finally {\n previousComparisons.clear();\n }\n}\n// Allow default imports as well.\nexport default equal;\nfunction check(a, b) {\n // If the two values are strictly equal, our job is easy.\n if (a === b) {\n return true;\n }\n // Object.prototype.toString returns a representation of the runtime type of\n // the given value that is considerably more precise than typeof.\n const aTag = toString.call(a);\n const bTag = toString.call(b);\n // If the runtime types of a and b are different, they could maybe be equal\n // under some interpretation of equality, but for simplicity and performance\n // we just return false instead.\n if (aTag !== bTag) {\n return false;\n }\n switch (aTag) {\n case '[object Array]':\n // Arrays are a lot like other objects, but we can cheaply compare their\n // lengths as a short-cut before comparing their elements.\n if (a.length !== b.length)\n return false;\n // Fall through to object case...\n case '[object Object]': {\n if (previouslyCompared(a, b))\n return true;\n const aKeys = definedKeys(a);\n const bKeys = definedKeys(b);\n // If `a` and `b` have a different number of enumerable keys, they\n // must be different.\n const keyCount = aKeys.length;\n if (keyCount !== bKeys.length)\n return false;\n // Now make sure they have the same keys.\n for (let k = 0; k < keyCount; ++k) {\n if (!hasOwnProperty.call(b, aKeys[k])) {\n return false;\n }\n }\n // Finally, check deep equality of all child properties.\n for (let k = 0; k < keyCount; ++k) {\n const key = aKeys[k];\n if (!check(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n case '[object Error]':\n return a.name === b.name && a.message === b.message;\n case '[object Number]':\n // Handle NaN, which is !== itself.\n if (a !== a)\n return b !== b;\n // Fall through to shared +a === +b case...\n case '[object Boolean]':\n case '[object Date]':\n return +a === +b;\n case '[object RegExp]':\n case '[object String]':\n return a == `${b}`;\n case '[object Map]':\n case '[object Set]': {\n if (a.size !== b.size)\n return false;\n if (previouslyCompared(a, b))\n return true;\n const aIterator = a.entries();\n const isMap = aTag === '[object Map]';\n while (true) {\n const info = aIterator.next();\n if (info.done)\n break;\n // If a instanceof Set, aValue === aKey.\n const [aKey, aValue] = info.value;\n // So this works the same way for both Set and Map.\n if (!b.has(aKey)) {\n return false;\n }\n // However, we care about deep equality of values only when dealing\n // with Map structures.\n if (isMap && !check(aValue, b.get(aKey))) {\n return false;\n }\n }\n return true;\n }\n case '[object Uint16Array]':\n case '[object Uint8Array]': // Buffer, in Node.js.\n case '[object Uint32Array]':\n case '[object Int32Array]':\n case '[object Int8Array]':\n case '[object Int16Array]':\n case '[object ArrayBuffer]':\n // DataView doesn't need these conversions, but the equality check is\n // otherwise the same.\n a = new Uint8Array(a);\n b = new Uint8Array(b);\n // Fall through...\n case '[object DataView]': {\n let len = a.byteLength;\n if (len === b.byteLength) {\n while (len-- && a[len] === b[len]) {\n // Keep looping as long as the bytes are equal.\n }\n }\n return len === -1;\n }\n case '[object AsyncFunction]':\n case '[object GeneratorFunction]':\n case '[object AsyncGeneratorFunction]':\n case '[object Function]': {\n const aCode = fnToStr.call(a);\n if (aCode !== fnToStr.call(b)) {\n return false;\n }\n // We consider non-native functions equal if they have the same code\n // (native functions require === because their code is censored).\n // Note that this behavior is not entirely sound, since !== function\n // objects with the same code can behave differently depending on\n // their closure scope. However, any function can behave differently\n // depending on the values of its input arguments (including this)\n // and its calling context (including its closure scope), even\n // though the function object is === to itself; and it is entirely\n // possible for functions that are not === to behave exactly the\n // same under all conceivable circumstances. Because none of these\n // factors are statically decidable in JavaScript, JS function\n // equality is not well-defined. This ambiguity allows us to\n // consider the best possible heuristic among various imperfect\n // options, and equating non-native functions that have the same\n // code has enormous practical benefits, such as when comparing\n // functions that are repeatedly passed as fresh function\n // expressions within objects that are otherwise deeply equal. Since\n // any function created from the same syntactic expression (in the\n // same code location) will always stringify to the same code\n // according to fnToStr.call, we can reasonably expect these\n // repeatedly passed function expressions to have the same code, and\n // thus behave \"the same\" (with all the caveats mentioned above),\n // even though the runtime function objects are !== to one another.\n return !endsWith(aCode, nativeCodeSuffix);\n }\n }\n // Otherwise the values are not equal.\n return false;\n}\nfunction definedKeys(obj) {\n // Remember that the second argument to Array.prototype.filter will be\n // used as `this` within the callback function.\n return Object.keys(obj).filter(isDefinedKey, obj);\n}\nfunction isDefinedKey(key) {\n return this[key] !== void 0;\n}\nconst nativeCodeSuffix = \"{ [native code] }\";\nfunction endsWith(full, suffix) {\n const fromIndex = full.length - suffix.length;\n return fromIndex >= 0 &&\n full.indexOf(suffix, fromIndex) === fromIndex;\n}\nfunction previouslyCompared(a, b) {\n // Though cyclic references can make an object graph appear infinite from the\n // perspective of a depth-first traversal, the graph still contains a finite\n // number of distinct object references. We use the previousComparisons cache\n // to avoid comparing the same pair of object references more than once, which\n // guarantees termination (even if we end up comparing every object in one\n // graph to every object in the other graph, which is extremely unlikely),\n // while still allowing weird isomorphic structures (like rings with different\n // lengths) a chance to pass the equality test.\n let bSet = previousComparisons.get(a);\n if (bSet) {\n // Return true here because we can be sure false will be returned somewhere\n // else if the objects are not equivalent.\n if (bSet.has(b))\n return true;\n }\n else {\n previousComparisons.set(a, bSet = new Set);\n }\n bSet.add(b);\n return false;\n}\n//# sourceMappingURL=index.js.map","// A [trie](https://en.wikipedia.org/wiki/Trie) data structure that holds\r\n// object keys weakly, yet can also hold non-object keys, unlike the\r\n// native `WeakMap`.\r\n// If no makeData function is supplied, the looked-up data will be an empty,\r\n// null-prototype Object.\r\nvar defaultMakeData = function () { return Object.create(null); };\r\n// Useful for processing arguments objects as well as arrays.\r\nvar _a = Array.prototype, forEach = _a.forEach, slice = _a.slice;\r\nvar Trie = /** @class */ (function () {\r\n function Trie(weakness, makeData) {\r\n if (weakness === void 0) { weakness = true; }\r\n if (makeData === void 0) { makeData = defaultMakeData; }\r\n this.weakness = weakness;\r\n this.makeData = makeData;\r\n }\r\n Trie.prototype.lookup = function () {\r\n var array = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n array[_i] = arguments[_i];\r\n }\r\n return this.lookupArray(array);\r\n };\r\n Trie.prototype.lookupArray = function (array) {\r\n var node = this;\r\n forEach.call(array, function (key) { return node = node.getChildTrie(key); });\r\n return node.data || (node.data = this.makeData(slice.call(array)));\r\n };\r\n Trie.prototype.getChildTrie = function (key) {\r\n var map = this.weakness && isObjRef(key)\r\n ? this.weak || (this.weak = new WeakMap())\r\n : this.strong || (this.strong = new Map());\r\n var child = map.get(key);\r\n if (!child)\r\n map.set(key, child = new Trie(this.weakness, this.makeData));\r\n return child;\r\n };\r\n return Trie;\r\n}());\r\nfunction isObjRef(value) {\r\n switch (typeof value) {\r\n case \"object\":\r\n if (value === null)\r\n break;\r\n // Fall through to return true...\r\n case \"function\":\r\n return true;\r\n }\r\n return false;\r\n}\n\nexport { Trie };\n//# sourceMappingURL=trie.esm.js.map\n","// This currentContext variable will only be used if the makeSlotClass\n// function is called, which happens only if this is the first copy of the\n// @wry/context package to be imported.\nlet currentContext = null;\n// This unique internal object is used to denote the absence of a value\n// for a given Slot, and is never exposed to outside code.\nconst MISSING_VALUE = {};\nlet idCounter = 1;\n// Although we can't do anything about the cost of duplicated code from\n// accidentally bundling multiple copies of the @wry/context package, we can\n// avoid creating the Slot class more than once using makeSlotClass.\nconst makeSlotClass = () => class Slot {\n constructor() {\n // If you have a Slot object, you can find out its slot.id, but you cannot\n // guess the slot.id of a Slot you don't have access to, thanks to the\n // randomized suffix.\n this.id = [\n \"slot\",\n idCounter++,\n Date.now(),\n Math.random().toString(36).slice(2),\n ].join(\":\");\n }\n hasValue() {\n for (let context = currentContext; context; context = context.parent) {\n // We use the Slot object iself as a key to its value, which means the\n // value cannot be obtained without a reference to the Slot object.\n if (this.id in context.slots) {\n const value = context.slots[this.id];\n if (value === MISSING_VALUE)\n break;\n if (context !== currentContext) {\n // Cache the value in currentContext.slots so the next lookup will\n // be faster. This caching is safe because the tree of contexts and\n // the values of the slots are logically immutable.\n currentContext.slots[this.id] = value;\n }\n return true;\n }\n }\n if (currentContext) {\n // If a value was not found for this Slot, it's never going to be found\n // no matter how many times we look it up, so we might as well cache\n // the absence of the value, too.\n currentContext.slots[this.id] = MISSING_VALUE;\n }\n return false;\n }\n getValue() {\n if (this.hasValue()) {\n return currentContext.slots[this.id];\n }\n }\n withValue(value, callback, \n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args, thisArg) {\n const slots = {\n __proto__: null,\n [this.id]: value,\n };\n const parent = currentContext;\n currentContext = { parent, slots };\n try {\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg, args);\n }\n finally {\n currentContext = parent;\n }\n }\n // Capture the current context and wrap a callback function so that it\n // reestablishes the captured context when called.\n static bind(callback) {\n const context = currentContext;\n return function () {\n const saved = currentContext;\n try {\n currentContext = context;\n return callback.apply(this, arguments);\n }\n finally {\n currentContext = saved;\n }\n };\n }\n // Immediately run a callback function without any captured context.\n static noContext(callback, \n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args, thisArg) {\n if (currentContext) {\n const saved = currentContext;\n try {\n currentContext = null;\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg, args);\n }\n finally {\n currentContext = saved;\n }\n }\n else {\n return callback.apply(thisArg, args);\n }\n }\n};\nfunction maybe(fn) {\n try {\n return fn();\n }\n catch (ignored) { }\n}\n// We store a single global implementation of the Slot class as a permanent\n// non-enumerable property of the globalThis object. This obfuscation does\n// nothing to prevent access to the Slot class, but at least it ensures the\n// implementation (i.e. currentContext) cannot be tampered with, and all copies\n// of the @wry/context package (hopefully just one) will share the same Slot\n// implementation. Since the first copy of the @wry/context package to be\n// imported wins, this technique imposes a steep cost for any future breaking\n// changes to the Slot class.\nconst globalKey = \"@wry/context:Slot\";\nconst host = \n// Prefer globalThis when available.\n// https://github.com/benjamn/wryware/issues/347\nmaybe(() => globalThis) ||\n // Fall back to global, which works in Node.js and may be converted by some\n // bundlers to the appropriate identifier (window, self, ...) depending on the\n // bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224\n maybe(() => global) ||\n // Otherwise, use a dummy host that's local to this module. We used to fall\n // back to using the Array constructor as a namespace, but that was flagged in\n // https://github.com/benjamn/wryware/issues/347, and can be avoided.\n Object.create(null);\n// Whichever globalHost we're using, make TypeScript happy about the additional\n// globalKey property.\nconst globalHost = host;\nexport const Slot = globalHost[globalKey] ||\n // Earlier versions of this package stored the globalKey property on the Array\n // constructor, so we check there as well, to prevent Slot class duplication.\n Array[globalKey] ||\n (function (Slot) {\n try {\n Object.defineProperty(globalHost, globalKey, {\n value: Slot,\n enumerable: false,\n writable: false,\n // When it was possible for globalHost to be the Array constructor (a\n // legacy Slot dedup strategy), it was important for the property to be\n // configurable:true so it could be deleted. That does not seem to be as\n // important when globalHost is the global object, but I don't want to\n // cause similar problems again, and configurable:true seems safest.\n // https://github.com/endojs/endo/issues/576#issuecomment-1178274008\n configurable: true\n });\n }\n finally {\n return Slot;\n }\n })(makeSlotClass());\n//# sourceMappingURL=slot.js.map","import { Trie } from '@wry/trie';\nexport { Trie as KeyTrie } from '@wry/trie';\nimport { Slot } from '@wry/context';\nexport { asyncFromGen, bind as bindContext, noContext, setTimeout } from '@wry/context';\n\nfunction defaultDispose() { }\r\nvar Cache = /** @class */ (function () {\r\n function Cache(max, dispose) {\r\n if (max === void 0) { max = Infinity; }\r\n if (dispose === void 0) { dispose = defaultDispose; }\r\n this.max = max;\r\n this.dispose = dispose;\r\n this.map = new Map();\r\n this.newest = null;\r\n this.oldest = null;\r\n }\r\n Cache.prototype.has = function (key) {\r\n return this.map.has(key);\r\n };\r\n Cache.prototype.get = function (key) {\r\n var node = this.getNode(key);\r\n return node && node.value;\r\n };\r\n Cache.prototype.getNode = function (key) {\r\n var node = this.map.get(key);\r\n if (node && node !== this.newest) {\r\n var older = node.older, newer = node.newer;\r\n if (newer) {\r\n newer.older = older;\r\n }\r\n if (older) {\r\n older.newer = newer;\r\n }\r\n node.older = this.newest;\r\n node.older.newer = node;\r\n node.newer = null;\r\n this.newest = node;\r\n if (node === this.oldest) {\r\n this.oldest = newer;\r\n }\r\n }\r\n return node;\r\n };\r\n Cache.prototype.set = function (key, value) {\r\n var node = this.getNode(key);\r\n if (node) {\r\n return node.value = value;\r\n }\r\n node = {\r\n key: key,\r\n value: value,\r\n newer: null,\r\n older: this.newest\r\n };\r\n if (this.newest) {\r\n this.newest.newer = node;\r\n }\r\n this.newest = node;\r\n this.oldest = this.oldest || node;\r\n this.map.set(key, node);\r\n return node.value;\r\n };\r\n Cache.prototype.clean = function () {\r\n while (this.oldest && this.map.size > this.max) {\r\n this.delete(this.oldest.key);\r\n }\r\n };\r\n Cache.prototype.delete = function (key) {\r\n var node = this.map.get(key);\r\n if (node) {\r\n if (node === this.newest) {\r\n this.newest = node.older;\r\n }\r\n if (node === this.oldest) {\r\n this.oldest = node.newer;\r\n }\r\n if (node.newer) {\r\n node.newer.older = node.older;\r\n }\r\n if (node.older) {\r\n node.older.newer = node.newer;\r\n }\r\n this.map.delete(key);\r\n this.dispose(node.value, key);\r\n return true;\r\n }\r\n return false;\r\n };\r\n return Cache;\r\n}());\n\nvar parentEntrySlot = new Slot();\n\nvar _a;\r\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\r\nvar \r\n// This Array.from polyfill is restricted to working with Set for now,\r\n// but we can improve the polyfill and add other input types, as needed. Note\r\n// that this fallback implementation will only be used if the host environment\r\n// does not support a native Array.from function. In most modern JS runtimes,\r\n// the toArray function exported here will be === Array.from.\r\ntoArray = (_a = Array.from, _a === void 0 ? function (collection) {\r\n var array = [];\r\n collection.forEach(function (item) { return array.push(item); });\r\n return array;\r\n} : _a);\r\nfunction maybeUnsubscribe(entryOrDep) {\r\n var unsubscribe = entryOrDep.unsubscribe;\r\n if (typeof unsubscribe === \"function\") {\r\n entryOrDep.unsubscribe = void 0;\r\n unsubscribe();\r\n }\r\n}\n\nvar emptySetPool = [];\r\nvar POOL_TARGET_SIZE = 100;\r\n// Since this package might be used browsers, we should avoid using the\r\n// Node built-in assert module.\r\nfunction assert(condition, optionalMessage) {\r\n if (!condition) {\r\n throw new Error(optionalMessage || \"assertion failure\");\r\n }\r\n}\r\nfunction valueIs(a, b) {\r\n var len = a.length;\r\n return (\r\n // Unknown values are not equal to each other.\r\n len > 0 &&\r\n // Both values must be ordinary (or both exceptional) to be equal.\r\n len === b.length &&\r\n // The underlying value or exception must be the same.\r\n a[len - 1] === b[len - 1]);\r\n}\r\nfunction valueGet(value) {\r\n switch (value.length) {\r\n case 0: throw new Error(\"unknown value\");\r\n case 1: return value[0];\r\n case 2: throw value[1];\r\n }\r\n}\r\nfunction valueCopy(value) {\r\n return value.slice(0);\r\n}\r\nvar Entry = /** @class */ (function () {\r\n function Entry(fn) {\r\n this.fn = fn;\r\n this.parents = new Set();\r\n this.childValues = new Map();\r\n // When this Entry has children that are dirty, this property becomes\r\n // a Set containing other Entry objects, borrowed from emptySetPool.\r\n // When the set becomes empty, it gets recycled back to emptySetPool.\r\n this.dirtyChildren = null;\r\n this.dirty = true;\r\n this.recomputing = false;\r\n this.value = [];\r\n this.deps = null;\r\n ++Entry.count;\r\n }\r\n Entry.prototype.peek = function () {\r\n if (this.value.length === 1 && !mightBeDirty(this)) {\r\n rememberParent(this);\r\n return this.value[0];\r\n }\r\n };\r\n // This is the most important method of the Entry API, because it\r\n // determines whether the cached this.value can be returned immediately,\r\n // or must be recomputed. The overall performance of the caching system\r\n // depends on the truth of the following observations: (1) this.dirty is\r\n // usually false, (2) this.dirtyChildren is usually null/empty, and thus\r\n // (3) valueGet(this.value) is usually returned without recomputation.\r\n Entry.prototype.recompute = function (args) {\r\n assert(!this.recomputing, \"already recomputing\");\r\n rememberParent(this);\r\n return mightBeDirty(this)\r\n ? reallyRecompute(this, args)\r\n : valueGet(this.value);\r\n };\r\n Entry.prototype.setDirty = function () {\r\n if (this.dirty)\r\n return;\r\n this.dirty = true;\r\n this.value.length = 0;\r\n reportDirty(this);\r\n // We can go ahead and unsubscribe here, since any further dirty\r\n // notifications we receive will be redundant, and unsubscribing may\r\n // free up some resources, e.g. file watchers.\r\n maybeUnsubscribe(this);\r\n };\r\n Entry.prototype.dispose = function () {\r\n var _this = this;\r\n this.setDirty();\r\n // Sever any dependency relationships with our own children, so those\r\n // children don't retain this parent Entry in their child.parents sets,\r\n // thereby preventing it from being fully garbage collected.\r\n forgetChildren(this);\r\n // Because this entry has been kicked out of the cache (in index.js),\r\n // we've lost the ability to find out if/when this entry becomes dirty,\r\n // whether that happens through a subscription, because of a direct call\r\n // to entry.setDirty(), or because one of its children becomes dirty.\r\n // Because of this loss of future information, we have to assume the\r\n // worst (that this entry might have become dirty very soon), so we must\r\n // immediately mark this entry's parents as dirty. Normally we could\r\n // just call entry.setDirty() rather than calling parent.setDirty() for\r\n // each parent, but that would leave this entry in parent.childValues\r\n // and parent.dirtyChildren, which would prevent the child from being\r\n // truly forgotten.\r\n eachParent(this, function (parent, child) {\r\n parent.setDirty();\r\n forgetChild(parent, _this);\r\n });\r\n };\r\n Entry.prototype.forget = function () {\r\n // The code that creates Entry objects in index.ts will replace this method\r\n // with one that actually removes the Entry from the cache, which will also\r\n // trigger the entry.dispose method.\r\n this.dispose();\r\n };\r\n Entry.prototype.dependOn = function (dep) {\r\n dep.add(this);\r\n if (!this.deps) {\r\n this.deps = emptySetPool.pop() || new Set();\r\n }\r\n this.deps.add(dep);\r\n };\r\n Entry.prototype.forgetDeps = function () {\r\n var _this = this;\r\n if (this.deps) {\r\n toArray(this.deps).forEach(function (dep) { return dep.delete(_this); });\r\n this.deps.clear();\r\n emptySetPool.push(this.deps);\r\n this.deps = null;\r\n }\r\n };\r\n Entry.count = 0;\r\n return Entry;\r\n}());\r\nfunction rememberParent(child) {\r\n var parent = parentEntrySlot.getValue();\r\n if (parent) {\r\n child.parents.add(parent);\r\n if (!parent.childValues.has(child)) {\r\n parent.childValues.set(child, []);\r\n }\r\n if (mightBeDirty(child)) {\r\n reportDirtyChild(parent, child);\r\n }\r\n else {\r\n reportCleanChild(parent, child);\r\n }\r\n return parent;\r\n }\r\n}\r\nfunction reallyRecompute(entry, args) {\r\n forgetChildren(entry);\r\n // Set entry as the parent entry while calling recomputeNewValue(entry).\r\n parentEntrySlot.withValue(entry, recomputeNewValue, [entry, args]);\r\n if (maybeSubscribe(entry, args)) {\r\n // If we successfully recomputed entry.value and did not fail to\r\n // (re)subscribe, then this Entry is no longer explicitly dirty.\r\n setClean(entry);\r\n }\r\n return valueGet(entry.value);\r\n}\r\nfunction recomputeNewValue(entry, args) {\r\n entry.recomputing = true;\r\n // Set entry.value as unknown.\r\n entry.value.length = 0;\r\n try {\r\n // If entry.fn succeeds, entry.value will become a normal Value.\r\n entry.value[0] = entry.fn.apply(null, args);\r\n }\r\n catch (e) {\r\n // If entry.fn throws, entry.value will become exceptional.\r\n entry.value[1] = e;\r\n }\r\n // Either way, this line is always reached.\r\n entry.recomputing = false;\r\n}\r\nfunction mightBeDirty(entry) {\r\n return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);\r\n}\r\nfunction setClean(entry) {\r\n entry.dirty = false;\r\n if (mightBeDirty(entry)) {\r\n // This Entry may still have dirty children, in which case we can't\r\n // let our parents know we're clean just yet.\r\n return;\r\n }\r\n reportClean(entry);\r\n}\r\nfunction reportDirty(child) {\r\n eachParent(child, reportDirtyChild);\r\n}\r\nfunction reportClean(child) {\r\n eachParent(child, reportCleanChild);\r\n}\r\nfunction eachParent(child, callback) {\r\n var parentCount = child.parents.size;\r\n if (parentCount) {\r\n var parents = toArray(child.parents);\r\n for (var i = 0; i < parentCount; ++i) {\r\n callback(parents[i], child);\r\n }\r\n }\r\n}\r\n// Let a parent Entry know that one of its children may be dirty.\r\nfunction reportDirtyChild(parent, child) {\r\n // Must have called rememberParent(child) before calling\r\n // reportDirtyChild(parent, child).\r\n assert(parent.childValues.has(child));\r\n assert(mightBeDirty(child));\r\n var parentWasClean = !mightBeDirty(parent);\r\n if (!parent.dirtyChildren) {\r\n parent.dirtyChildren = emptySetPool.pop() || new Set;\r\n }\r\n else if (parent.dirtyChildren.has(child)) {\r\n // If we already know this child is dirty, then we must have already\r\n // informed our own parents that we are dirty, so we can terminate\r\n // the recursion early.\r\n return;\r\n }\r\n parent.dirtyChildren.add(child);\r\n // If parent was clean before, it just became (possibly) dirty (according to\r\n // mightBeDirty), since we just added child to parent.dirtyChildren.\r\n if (parentWasClean) {\r\n reportDirty(parent);\r\n }\r\n}\r\n// Let a parent Entry know that one of its children is no longer dirty.\r\nfunction reportCleanChild(parent, child) {\r\n // Must have called rememberChild(child) before calling\r\n // reportCleanChild(parent, child).\r\n assert(parent.childValues.has(child));\r\n assert(!mightBeDirty(child));\r\n var childValue = parent.childValues.get(child);\r\n if (childValue.length === 0) {\r\n parent.childValues.set(child, valueCopy(child.value));\r\n }\r\n else if (!valueIs(childValue, child.value)) {\r\n parent.setDirty();\r\n }\r\n removeDirtyChild(parent, child);\r\n if (mightBeDirty(parent)) {\r\n return;\r\n }\r\n reportClean(parent);\r\n}\r\nfunction removeDirtyChild(parent, child) {\r\n var dc = parent.dirtyChildren;\r\n if (dc) {\r\n dc.delete(child);\r\n if (dc.size === 0) {\r\n if (emptySetPool.length < POOL_TARGET_SIZE) {\r\n emptySetPool.push(dc);\r\n }\r\n parent.dirtyChildren = null;\r\n }\r\n }\r\n}\r\n// Removes all children from this entry and returns an array of the\r\n// removed children.\r\nfunction forgetChildren(parent) {\r\n if (parent.childValues.size > 0) {\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n });\r\n }\r\n // Remove this parent Entry from any sets to which it was added by the\r\n // addToSet method.\r\n parent.forgetDeps();\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n}\r\nfunction forgetChild(parent, child) {\r\n child.parents.delete(parent);\r\n parent.childValues.delete(child);\r\n removeDirtyChild(parent, child);\r\n}\r\nfunction maybeSubscribe(entry, args) {\r\n if (typeof entry.subscribe === \"function\") {\r\n try {\r\n maybeUnsubscribe(entry); // Prevent double subscriptions.\r\n entry.unsubscribe = entry.subscribe.apply(null, args);\r\n }\r\n catch (e) {\r\n // If this Entry has a subscribe function and it threw an exception\r\n // (or an unsubscribe function it previously returned now throws),\r\n // return false to indicate that we were not able to subscribe (or\r\n // unsubscribe), and this Entry should remain dirty.\r\n entry.setDirty();\r\n return false;\r\n }\r\n }\r\n // Returning true indicates either that there was no entry.subscribe\r\n // function or that it succeeded.\r\n return true;\r\n}\n\nvar EntryMethods = {\r\n setDirty: true,\r\n dispose: true,\r\n forget: true, // Fully remove parent Entry from LRU cache and computation graph\r\n};\r\nfunction dep(options) {\r\n var depsByKey = new Map();\r\n var subscribe = options && options.subscribe;\r\n function depend(key) {\r\n var parent = parentEntrySlot.getValue();\r\n if (parent) {\r\n var dep_1 = depsByKey.get(key);\r\n if (!dep_1) {\r\n depsByKey.set(key, dep_1 = new Set);\r\n }\r\n parent.dependOn(dep_1);\r\n if (typeof subscribe === \"function\") {\r\n maybeUnsubscribe(dep_1);\r\n dep_1.unsubscribe = subscribe(key);\r\n }\r\n }\r\n }\r\n depend.dirty = function dirty(key, entryMethodName) {\r\n var dep = depsByKey.get(key);\r\n if (dep) {\r\n var m_1 = (entryMethodName &&\r\n hasOwnProperty.call(EntryMethods, entryMethodName)) ? entryMethodName : \"setDirty\";\r\n // We have to use toArray(dep).forEach instead of dep.forEach, because\r\n // modifying a Set while iterating over it can cause elements in the Set\r\n // to be removed from the Set before they've been iterated over.\r\n toArray(dep).forEach(function (entry) { return entry[m_1](); });\r\n depsByKey.delete(key);\r\n maybeUnsubscribe(dep);\r\n }\r\n };\r\n return depend;\r\n}\n\nfunction makeDefaultMakeCacheKeyFunction() {\r\n var keyTrie = new Trie(typeof WeakMap === \"function\");\r\n return function () {\r\n return keyTrie.lookupArray(arguments);\r\n };\r\n}\r\n// The defaultMakeCacheKey function is remarkably powerful, because it gives\r\n// a unique object for any shallow-identical list of arguments. If you need\r\n// to implement a custom makeCacheKey function, you may find it helpful to\r\n// delegate the final work to defaultMakeCacheKey, which is why we export it\r\n// here. However, you may want to avoid defaultMakeCacheKey if your runtime\r\n// does not support WeakMap, or you have the ability to return a string key.\r\n// In those cases, just write your own custom makeCacheKey functions.\r\nvar defaultMakeCacheKey = makeDefaultMakeCacheKeyFunction();\r\nvar caches = new Set();\r\nfunction wrap(originalFunction, options) {\r\n if (options === void 0) { options = Object.create(null); }\r\n var cache = new Cache(options.max || Math.pow(2, 16), function (entry) { return entry.dispose(); });\r\n var keyArgs = options.keyArgs;\r\n var makeCacheKey = options.makeCacheKey ||\r\n makeDefaultMakeCacheKeyFunction();\r\n var optimistic = function () {\r\n var key = makeCacheKey.apply(null, keyArgs ? keyArgs.apply(null, arguments) : arguments);\r\n if (key === void 0) {\r\n return originalFunction.apply(null, arguments);\r\n }\r\n var entry = cache.get(key);\r\n if (!entry) {\r\n cache.set(key, entry = new Entry(originalFunction));\r\n entry.subscribe = options.subscribe;\r\n // Give the Entry the ability to trigger cache.delete(key), even though\r\n // the Entry itself does not know about key or cache.\r\n entry.forget = function () { return cache.delete(key); };\r\n }\r\n var value = entry.recompute(Array.prototype.slice.call(arguments));\r\n // Move this entry to the front of the least-recently used queue,\r\n // since we just finished computing its value.\r\n cache.set(key, entry);\r\n caches.add(cache);\r\n // Clean up any excess entries in the cache, but only if there is no\r\n // active parent entry, meaning we're not in the middle of a larger\r\n // computation that might be flummoxed by the cleaning.\r\n if (!parentEntrySlot.hasValue()) {\r\n caches.forEach(function (cache) { return cache.clean(); });\r\n caches.clear();\r\n }\r\n return value;\r\n };\r\n Object.defineProperty(optimistic, \"size\", {\r\n get: function () {\r\n return cache[\"map\"].size;\r\n },\r\n configurable: false,\r\n enumerable: false,\r\n });\r\n function dirtyKey(key) {\r\n var entry = cache.get(key);\r\n if (entry) {\r\n entry.setDirty();\r\n }\r\n }\r\n optimistic.dirtyKey = dirtyKey;\r\n optimistic.dirty = function dirty() {\r\n dirtyKey(makeCacheKey.apply(null, arguments));\r\n };\r\n function peekKey(key) {\r\n var entry = cache.get(key);\r\n if (entry) {\r\n return entry.peek();\r\n }\r\n }\r\n optimistic.peekKey = peekKey;\r\n optimistic.peek = function peek() {\r\n return peekKey(makeCacheKey.apply(null, arguments));\r\n };\r\n function forgetKey(key) {\r\n return cache.delete(key);\r\n }\r\n optimistic.forgetKey = forgetKey;\r\n optimistic.forget = function forget() {\r\n return forgetKey(makeCacheKey.apply(null, arguments));\r\n };\r\n optimistic.makeCacheKey = makeCacheKey;\r\n optimistic.getKey = keyArgs ? function getKey() {\r\n return makeCacheKey.apply(null, keyArgs.apply(null, arguments));\r\n } : makeCacheKey;\r\n return Object.freeze(optimistic);\r\n}\n\nexport { defaultMakeCacheKey, dep, wrap };\n//# sourceMappingURL=bundle.esm.js.map\n","import { __assign, __rest } from \"tslib\";\nimport { wrap } from 'optimism';\nimport { getFragmentQueryDocument, } from \"../../utilities/index.js\";\nvar ApolloCache = (function () {\n function ApolloCache() {\n this.getFragmentDoc = wrap(getFragmentQueryDocument);\n }\n ApolloCache.prototype.batch = function (options) {\n var _this = this;\n var optimisticId = typeof options.optimistic === \"string\" ? options.optimistic :\n options.optimistic === false ? null : void 0;\n var updateResult;\n this.performTransaction(function () { return updateResult = options.update(_this); }, optimisticId);\n return updateResult;\n };\n ApolloCache.prototype.recordOptimisticTransaction = function (transaction, optimisticId) {\n this.performTransaction(transaction, optimisticId);\n };\n ApolloCache.prototype.transformDocument = function (document) {\n return document;\n };\n ApolloCache.prototype.transformForLink = function (document) {\n return document;\n };\n ApolloCache.prototype.identify = function (object) {\n return;\n };\n ApolloCache.prototype.gc = function () {\n return [];\n };\n ApolloCache.prototype.modify = function (options) {\n return false;\n };\n ApolloCache.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = !!options.optimistic; }\n return this.read(__assign(__assign({}, options), { rootId: options.id || 'ROOT_QUERY', optimistic: optimistic }));\n };\n ApolloCache.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = !!options.optimistic; }\n return this.read(__assign(__assign({}, options), { query: this.getFragmentDoc(options.fragment, options.fragmentName), rootId: options.id, optimistic: optimistic }));\n };\n ApolloCache.prototype.writeQuery = function (_a) {\n var id = _a.id, data = _a.data, options = __rest(_a, [\"id\", \"data\"]);\n return this.write(Object.assign(options, {\n dataId: id || 'ROOT_QUERY',\n result: data,\n }));\n };\n ApolloCache.prototype.writeFragment = function (_a) {\n var id = _a.id, data = _a.data, fragment = _a.fragment, fragmentName = _a.fragmentName, options = __rest(_a, [\"id\", \"data\", \"fragment\", \"fragmentName\"]);\n return this.write(Object.assign(options, {\n query: this.getFragmentDoc(fragment, fragmentName),\n dataId: id,\n result: data,\n }));\n };\n ApolloCache.prototype.updateQuery = function (options, update) {\n return this.batch({\n update: function (cache) {\n var value = cache.readQuery(options);\n var data = update(value);\n if (data === void 0 || data === null)\n return value;\n cache.writeQuery(__assign(__assign({}, options), { data: data }));\n return data;\n },\n });\n };\n ApolloCache.prototype.updateFragment = function (options, update) {\n return this.batch({\n update: function (cache) {\n var value = cache.readFragment(options);\n var data = update(value);\n if (data === void 0 || data === null)\n return value;\n cache.writeFragment(__assign(__assign({}, options), { data: data }));\n return data;\n },\n });\n };\n return ApolloCache;\n}());\nexport { ApolloCache };\n//# sourceMappingURL=cache.js.map","import { __extends } from \"tslib\";\nvar MissingFieldError = (function (_super) {\n __extends(MissingFieldError, _super);\n function MissingFieldError(message, path, query, variables) {\n var _a;\n var _this = _super.call(this, message) || this;\n _this.message = message;\n _this.path = path;\n _this.query = query;\n _this.variables = variables;\n if (Array.isArray(_this.path)) {\n _this.missing = _this.message;\n for (var i = _this.path.length - 1; i >= 0; --i) {\n _this.missing = (_a = {}, _a[_this.path[i]] = _this.missing, _a);\n }\n }\n else {\n _this.missing = _this.path;\n }\n _this.__proto__ = MissingFieldError.prototype;\n return _this;\n }\n return MissingFieldError;\n}(Error));\nexport { MissingFieldError };\n//# sourceMappingURL=common.js.map","// A [trie](https://en.wikipedia.org/wiki/Trie) data structure that holds\n// object keys weakly, yet can also hold non-object keys, unlike the\n// native `WeakMap`.\n// If no makeData function is supplied, the looked-up data will be an empty,\n// null-prototype Object.\nconst defaultMakeData = () => Object.create(null);\n// Useful for processing arguments objects as well as arrays.\nconst { forEach, slice } = Array.prototype;\nconst { hasOwnProperty } = Object.prototype;\nexport class Trie {\n constructor(weakness = true, makeData = defaultMakeData) {\n this.weakness = weakness;\n this.makeData = makeData;\n }\n lookup(...array) {\n return this.lookupArray(array);\n }\n lookupArray(array) {\n let node = this;\n forEach.call(array, key => node = node.getChildTrie(key));\n return hasOwnProperty.call(node, \"data\")\n ? node.data\n : node.data = this.makeData(slice.call(array));\n }\n peek(...array) {\n return this.peekArray(array);\n }\n peekArray(array) {\n let node = this;\n for (let i = 0, len = array.length; node && i < len; ++i) {\n const map = this.weakness && isObjRef(array[i]) ? node.weak : node.strong;\n node = map && map.get(array[i]);\n }\n return node && node.data;\n }\n getChildTrie(key) {\n const map = this.weakness && isObjRef(key)\n ? this.weak || (this.weak = new WeakMap())\n : this.strong || (this.strong = new Map());\n let child = map.get(key);\n if (!child)\n map.set(key, child = new Trie(this.weakness, this.makeData));\n return child;\n }\n}\nfunction isObjRef(value) {\n switch (typeof value) {\n case \"object\":\n if (value === null)\n break;\n // Fall through to return true...\n case \"function\":\n return true;\n }\n return false;\n}\n//# sourceMappingURL=index.js.map","import { isReference, isField, DeepMerger, resultKeyNameFromField, shouldInclude, isNonNullObject, compact, createFragmentMap, getFragmentDefinitions, isArray, } from \"../../utilities/index.js\";\nexport var hasOwn = Object.prototype.hasOwnProperty;\nexport function isNullish(value) {\n return value === null || value === void 0;\n}\nexport { isArray };\nexport function defaultDataIdFromObject(_a, context) {\n var __typename = _a.__typename, id = _a.id, _id = _a._id;\n if (typeof __typename === \"string\") {\n if (context) {\n context.keyObject =\n !isNullish(id) ? { id: id } :\n !isNullish(_id) ? { _id: _id } :\n void 0;\n }\n if (isNullish(id) && !isNullish(_id)) {\n id = _id;\n }\n if (!isNullish(id)) {\n return \"\".concat(__typename, \":\").concat((typeof id === \"number\" ||\n typeof id === \"string\") ? id : JSON.stringify(id));\n }\n }\n}\nvar defaultConfig = {\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n canonizeResults: false,\n};\nexport function normalizeConfig(config) {\n return compact(defaultConfig, config);\n}\nexport function shouldCanonizeResults(config) {\n var value = config.canonizeResults;\n return value === void 0 ? defaultConfig.canonizeResults : value;\n}\nexport function getTypenameFromStoreObject(store, objectOrReference) {\n return isReference(objectOrReference)\n ? store.get(objectOrReference.__ref, \"__typename\")\n : objectOrReference && objectOrReference.__typename;\n}\nexport var TypeOrFieldNameRegExp = /^[_a-z][_0-9a-z]*/i;\nexport function fieldNameFromStoreName(storeFieldName) {\n var match = storeFieldName.match(TypeOrFieldNameRegExp);\n return match ? match[0] : storeFieldName;\n}\nexport function selectionSetMatchesResult(selectionSet, result, variables) {\n if (isNonNullObject(result)) {\n return isArray(result)\n ? result.every(function (item) { return selectionSetMatchesResult(selectionSet, item, variables); })\n : selectionSet.selections.every(function (field) {\n if (isField(field) && shouldInclude(field, variables)) {\n var key = resultKeyNameFromField(field);\n return hasOwn.call(result, key) &&\n (!field.selectionSet ||\n selectionSetMatchesResult(field.selectionSet, result[key], variables));\n }\n return true;\n });\n }\n return false;\n}\nexport function storeValueIsStoreObject(value) {\n return isNonNullObject(value) &&\n !isReference(value) &&\n !isArray(value);\n}\nexport function makeProcessedFieldsMerger() {\n return new DeepMerger;\n}\nexport function extractFragmentContext(document, fragments) {\n var fragmentMap = createFragmentMap(getFragmentDefinitions(document));\n return {\n fragmentMap: fragmentMap,\n lookupFragment: function (name) {\n var def = fragmentMap[name];\n if (!def && fragments) {\n def = fragments.lookup(name);\n }\n return def || null;\n },\n };\n}\n//# sourceMappingURL=helpers.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport { dep } from 'optimism';\nimport { equal } from '@wry/equality';\nimport { Trie } from '@wry/trie';\nimport { isReference, makeReference, DeepMerger, maybeDeepFreeze, canUseWeakMap, isNonNullObject, } from \"../../utilities/index.js\";\nimport { hasOwn, fieldNameFromStoreName } from \"./helpers.js\";\nvar DELETE = Object.create(null);\nvar delModifier = function () { return DELETE; };\nvar INVALIDATE = Object.create(null);\nvar EntityStore = (function () {\n function EntityStore(policies, group) {\n var _this = this;\n this.policies = policies;\n this.group = group;\n this.data = Object.create(null);\n this.rootIds = Object.create(null);\n this.refs = Object.create(null);\n this.getFieldValue = function (objectOrReference, storeFieldName) { return maybeDeepFreeze(isReference(objectOrReference)\n ? _this.get(objectOrReference.__ref, storeFieldName)\n : objectOrReference && objectOrReference[storeFieldName]); };\n this.canRead = function (objOrRef) {\n return isReference(objOrRef)\n ? _this.has(objOrRef.__ref)\n : typeof objOrRef === \"object\";\n };\n this.toReference = function (objOrIdOrRef, mergeIntoStore) {\n if (typeof objOrIdOrRef === \"string\") {\n return makeReference(objOrIdOrRef);\n }\n if (isReference(objOrIdOrRef)) {\n return objOrIdOrRef;\n }\n var id = _this.policies.identify(objOrIdOrRef)[0];\n if (id) {\n var ref = makeReference(id);\n if (mergeIntoStore) {\n _this.merge(id, objOrIdOrRef);\n }\n return ref;\n }\n };\n }\n EntityStore.prototype.toObject = function () {\n return __assign({}, this.data);\n };\n EntityStore.prototype.has = function (dataId) {\n return this.lookup(dataId, true) !== void 0;\n };\n EntityStore.prototype.get = function (dataId, fieldName) {\n this.group.depend(dataId, fieldName);\n if (hasOwn.call(this.data, dataId)) {\n var storeObject = this.data[dataId];\n if (storeObject && hasOwn.call(storeObject, fieldName)) {\n return storeObject[fieldName];\n }\n }\n if (fieldName === \"__typename\" &&\n hasOwn.call(this.policies.rootTypenamesById, dataId)) {\n return this.policies.rootTypenamesById[dataId];\n }\n if (this instanceof Layer) {\n return this.parent.get(dataId, fieldName);\n }\n };\n EntityStore.prototype.lookup = function (dataId, dependOnExistence) {\n if (dependOnExistence)\n this.group.depend(dataId, \"__exists\");\n if (hasOwn.call(this.data, dataId)) {\n return this.data[dataId];\n }\n if (this instanceof Layer) {\n return this.parent.lookup(dataId, dependOnExistence);\n }\n if (this.policies.rootTypenamesById[dataId]) {\n return Object.create(null);\n }\n };\n EntityStore.prototype.merge = function (older, newer) {\n var _this = this;\n var dataId;\n if (isReference(older))\n older = older.__ref;\n if (isReference(newer))\n newer = newer.__ref;\n var existing = typeof older === \"string\"\n ? this.lookup(dataId = older)\n : older;\n var incoming = typeof newer === \"string\"\n ? this.lookup(dataId = newer)\n : newer;\n if (!incoming)\n return;\n __DEV__ ? invariant(typeof dataId === \"string\", \"store.merge expects a string ID\") : invariant(typeof dataId === \"string\", 1);\n var merged = new DeepMerger(storeObjectReconciler).merge(existing, incoming);\n this.data[dataId] = merged;\n if (merged !== existing) {\n delete this.refs[dataId];\n if (this.group.caching) {\n var fieldsToDirty_1 = Object.create(null);\n if (!existing)\n fieldsToDirty_1.__exists = 1;\n Object.keys(incoming).forEach(function (storeFieldName) {\n if (!existing || existing[storeFieldName] !== merged[storeFieldName]) {\n fieldsToDirty_1[storeFieldName] = 1;\n var fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName &&\n !_this.policies.hasKeyArgs(merged.__typename, fieldName)) {\n fieldsToDirty_1[fieldName] = 1;\n }\n if (merged[storeFieldName] === void 0 && !(_this instanceof Layer)) {\n delete merged[storeFieldName];\n }\n }\n });\n if (fieldsToDirty_1.__typename &&\n !(existing && existing.__typename) &&\n this.policies.rootTypenamesById[dataId] === merged.__typename) {\n delete fieldsToDirty_1.__typename;\n }\n Object.keys(fieldsToDirty_1).forEach(function (fieldName) { return _this.group.dirty(dataId, fieldName); });\n }\n }\n };\n EntityStore.prototype.modify = function (dataId, fields) {\n var _this = this;\n var storeObject = this.lookup(dataId);\n if (storeObject) {\n var changedFields_1 = Object.create(null);\n var needToMerge_1 = false;\n var allDeleted_1 = true;\n var sharedDetails_1 = {\n DELETE: DELETE,\n INVALIDATE: INVALIDATE,\n isReference: isReference,\n toReference: this.toReference,\n canRead: this.canRead,\n readField: function (fieldNameOrOptions, from) { return _this.policies.readField(typeof fieldNameOrOptions === \"string\" ? {\n fieldName: fieldNameOrOptions,\n from: from || makeReference(dataId),\n } : fieldNameOrOptions, { store: _this }); },\n };\n Object.keys(storeObject).forEach(function (storeFieldName) {\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var fieldValue = storeObject[storeFieldName];\n if (fieldValue === void 0)\n return;\n var modify = typeof fields === \"function\"\n ? fields\n : fields[storeFieldName] || fields[fieldName];\n if (modify) {\n var newValue = modify === delModifier ? DELETE :\n modify(maybeDeepFreeze(fieldValue), __assign(__assign({}, sharedDetails_1), { fieldName: fieldName, storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) }));\n if (newValue === INVALIDATE) {\n _this.group.dirty(dataId, storeFieldName);\n }\n else {\n if (newValue === DELETE)\n newValue = void 0;\n if (newValue !== fieldValue) {\n changedFields_1[storeFieldName] = newValue;\n needToMerge_1 = true;\n fieldValue = newValue;\n }\n }\n }\n if (fieldValue !== void 0) {\n allDeleted_1 = false;\n }\n });\n if (needToMerge_1) {\n this.merge(dataId, changedFields_1);\n if (allDeleted_1) {\n if (this instanceof Layer) {\n this.data[dataId] = void 0;\n }\n else {\n delete this.data[dataId];\n }\n this.group.dirty(dataId, \"__exists\");\n }\n return true;\n }\n }\n return false;\n };\n EntityStore.prototype.delete = function (dataId, fieldName, args) {\n var _a;\n var storeObject = this.lookup(dataId);\n if (storeObject) {\n var typename = this.getFieldValue(storeObject, \"__typename\");\n var storeFieldName = fieldName && args\n ? this.policies.getStoreFieldName({ typename: typename, fieldName: fieldName, args: args })\n : fieldName;\n return this.modify(dataId, storeFieldName ? (_a = {},\n _a[storeFieldName] = delModifier,\n _a) : delModifier);\n }\n return false;\n };\n EntityStore.prototype.evict = function (options, limit) {\n var evicted = false;\n if (options.id) {\n if (hasOwn.call(this.data, options.id)) {\n evicted = this.delete(options.id, options.fieldName, options.args);\n }\n if (this instanceof Layer && this !== limit) {\n evicted = this.parent.evict(options, limit) || evicted;\n }\n if (options.fieldName || evicted) {\n this.group.dirty(options.id, options.fieldName || \"__exists\");\n }\n }\n return evicted;\n };\n EntityStore.prototype.clear = function () {\n this.replace(null);\n };\n EntityStore.prototype.extract = function () {\n var _this = this;\n var obj = this.toObject();\n var extraRootIds = [];\n this.getRootIdSet().forEach(function (id) {\n if (!hasOwn.call(_this.policies.rootTypenamesById, id)) {\n extraRootIds.push(id);\n }\n });\n if (extraRootIds.length) {\n obj.__META = { extraRootIds: extraRootIds.sort() };\n }\n return obj;\n };\n EntityStore.prototype.replace = function (newData) {\n var _this = this;\n Object.keys(this.data).forEach(function (dataId) {\n if (!(newData && hasOwn.call(newData, dataId))) {\n _this.delete(dataId);\n }\n });\n if (newData) {\n var __META = newData.__META, rest_1 = __rest(newData, [\"__META\"]);\n Object.keys(rest_1).forEach(function (dataId) {\n _this.merge(dataId, rest_1[dataId]);\n });\n if (__META) {\n __META.extraRootIds.forEach(this.retain, this);\n }\n }\n };\n EntityStore.prototype.retain = function (rootId) {\n return this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1;\n };\n EntityStore.prototype.release = function (rootId) {\n if (this.rootIds[rootId] > 0) {\n var count = --this.rootIds[rootId];\n if (!count)\n delete this.rootIds[rootId];\n return count;\n }\n return 0;\n };\n EntityStore.prototype.getRootIdSet = function (ids) {\n if (ids === void 0) { ids = new Set(); }\n Object.keys(this.rootIds).forEach(ids.add, ids);\n if (this instanceof Layer) {\n this.parent.getRootIdSet(ids);\n }\n else {\n Object.keys(this.policies.rootTypenamesById).forEach(ids.add, ids);\n }\n return ids;\n };\n EntityStore.prototype.gc = function () {\n var _this = this;\n var ids = this.getRootIdSet();\n var snapshot = this.toObject();\n ids.forEach(function (id) {\n if (hasOwn.call(snapshot, id)) {\n Object.keys(_this.findChildRefIds(id)).forEach(ids.add, ids);\n delete snapshot[id];\n }\n });\n var idsToRemove = Object.keys(snapshot);\n if (idsToRemove.length) {\n var root_1 = this;\n while (root_1 instanceof Layer)\n root_1 = root_1.parent;\n idsToRemove.forEach(function (id) { return root_1.delete(id); });\n }\n return idsToRemove;\n };\n EntityStore.prototype.findChildRefIds = function (dataId) {\n if (!hasOwn.call(this.refs, dataId)) {\n var found_1 = this.refs[dataId] = Object.create(null);\n var root = this.data[dataId];\n if (!root)\n return found_1;\n var workSet_1 = new Set([root]);\n workSet_1.forEach(function (obj) {\n if (isReference(obj)) {\n found_1[obj.__ref] = true;\n }\n if (isNonNullObject(obj)) {\n Object.keys(obj).forEach(function (key) {\n var child = obj[key];\n if (isNonNullObject(child)) {\n workSet_1.add(child);\n }\n });\n }\n });\n }\n return this.refs[dataId];\n };\n EntityStore.prototype.makeCacheKey = function () {\n return this.group.keyMaker.lookupArray(arguments);\n };\n return EntityStore;\n}());\nexport { EntityStore };\nvar CacheGroup = (function () {\n function CacheGroup(caching, parent) {\n if (parent === void 0) { parent = null; }\n this.caching = caching;\n this.parent = parent;\n this.d = null;\n this.resetCaching();\n }\n CacheGroup.prototype.resetCaching = function () {\n this.d = this.caching ? dep() : null;\n this.keyMaker = new Trie(canUseWeakMap);\n };\n CacheGroup.prototype.depend = function (dataId, storeFieldName) {\n if (this.d) {\n this.d(makeDepKey(dataId, storeFieldName));\n var fieldName = fieldNameFromStoreName(storeFieldName);\n if (fieldName !== storeFieldName) {\n this.d(makeDepKey(dataId, fieldName));\n }\n if (this.parent) {\n this.parent.depend(dataId, storeFieldName);\n }\n }\n };\n CacheGroup.prototype.dirty = function (dataId, storeFieldName) {\n if (this.d) {\n this.d.dirty(makeDepKey(dataId, storeFieldName), storeFieldName === \"__exists\" ? \"forget\" : \"setDirty\");\n }\n };\n return CacheGroup;\n}());\nfunction makeDepKey(dataId, storeFieldName) {\n return storeFieldName + '#' + dataId;\n}\nexport function maybeDependOnExistenceOfEntity(store, entityId) {\n if (supportsResultCaching(store)) {\n store.group.depend(entityId, \"__exists\");\n }\n}\n(function (EntityStore) {\n var Root = (function (_super) {\n __extends(Root, _super);\n function Root(_a) {\n var policies = _a.policies, _b = _a.resultCaching, resultCaching = _b === void 0 ? true : _b, seed = _a.seed;\n var _this = _super.call(this, policies, new CacheGroup(resultCaching)) || this;\n _this.stump = new Stump(_this);\n _this.storageTrie = new Trie(canUseWeakMap);\n if (seed)\n _this.replace(seed);\n return _this;\n }\n Root.prototype.addLayer = function (layerId, replay) {\n return this.stump.addLayer(layerId, replay);\n };\n Root.prototype.removeLayer = function () {\n return this;\n };\n Root.prototype.getStorage = function () {\n return this.storageTrie.lookupArray(arguments);\n };\n return Root;\n }(EntityStore));\n EntityStore.Root = Root;\n})(EntityStore || (EntityStore = {}));\nvar Layer = (function (_super) {\n __extends(Layer, _super);\n function Layer(id, parent, replay, group) {\n var _this = _super.call(this, parent.policies, group) || this;\n _this.id = id;\n _this.parent = parent;\n _this.replay = replay;\n _this.group = group;\n replay(_this);\n return _this;\n }\n Layer.prototype.addLayer = function (layerId, replay) {\n return new Layer(layerId, this, replay, this.group);\n };\n Layer.prototype.removeLayer = function (layerId) {\n var _this = this;\n var parent = this.parent.removeLayer(layerId);\n if (layerId === this.id) {\n if (this.group.caching) {\n Object.keys(this.data).forEach(function (dataId) {\n var ownStoreObject = _this.data[dataId];\n var parentStoreObject = parent[\"lookup\"](dataId);\n if (!parentStoreObject) {\n _this.delete(dataId);\n }\n else if (!ownStoreObject) {\n _this.group.dirty(dataId, \"__exists\");\n Object.keys(parentStoreObject).forEach(function (storeFieldName) {\n _this.group.dirty(dataId, storeFieldName);\n });\n }\n else if (ownStoreObject !== parentStoreObject) {\n Object.keys(ownStoreObject).forEach(function (storeFieldName) {\n if (!equal(ownStoreObject[storeFieldName], parentStoreObject[storeFieldName])) {\n _this.group.dirty(dataId, storeFieldName);\n }\n });\n }\n });\n }\n return parent;\n }\n if (parent === this.parent)\n return this;\n return parent.addLayer(this.id, this.replay);\n };\n Layer.prototype.toObject = function () {\n return __assign(__assign({}, this.parent.toObject()), this.data);\n };\n Layer.prototype.findChildRefIds = function (dataId) {\n var fromParent = this.parent.findChildRefIds(dataId);\n return hasOwn.call(this.data, dataId) ? __assign(__assign({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;\n };\n Layer.prototype.getStorage = function () {\n var p = this.parent;\n while (p.parent)\n p = p.parent;\n return p.getStorage.apply(p, arguments);\n };\n return Layer;\n}(EntityStore));\nvar Stump = (function (_super) {\n __extends(Stump, _super);\n function Stump(root) {\n return _super.call(this, \"EntityStore.Stump\", root, function () { }, new CacheGroup(root.group.caching, root.group)) || this;\n }\n Stump.prototype.removeLayer = function () {\n return this;\n };\n Stump.prototype.merge = function () {\n return this.parent.merge.apply(this.parent, arguments);\n };\n return Stump;\n}(Layer));\nfunction storeObjectReconciler(existingObject, incomingObject, property) {\n var existingValue = existingObject[property];\n var incomingValue = incomingObject[property];\n return equal(existingValue, incomingValue) ? existingValue : incomingValue;\n}\nexport function supportsResultCaching(store) {\n return !!(store instanceof EntityStore && store.group.caching);\n}\n//# sourceMappingURL=entityStore.js.map","import { __assign } from \"tslib\";\nimport \"../../utilities/globals/index.js\";\nimport { Trie } from \"@wry/trie\";\nimport { canUseWeakMap, canUseWeakSet, isNonNullObject as isObjectOrArray, } from \"../../utilities/index.js\";\nimport { isArray } from \"./helpers.js\";\nfunction shallowCopy(value) {\n if (isObjectOrArray(value)) {\n return isArray(value)\n ? value.slice(0)\n : __assign({ __proto__: Object.getPrototypeOf(value) }, value);\n }\n return value;\n}\nvar ObjectCanon = (function () {\n function ObjectCanon() {\n this.known = new (canUseWeakSet ? WeakSet : Set)();\n this.pool = new Trie(canUseWeakMap);\n this.passes = new WeakMap();\n this.keysByJSON = new Map();\n this.empty = this.admit({});\n }\n ObjectCanon.prototype.isKnown = function (value) {\n return isObjectOrArray(value) && this.known.has(value);\n };\n ObjectCanon.prototype.pass = function (value) {\n if (isObjectOrArray(value)) {\n var copy = shallowCopy(value);\n this.passes.set(copy, value);\n return copy;\n }\n return value;\n };\n ObjectCanon.prototype.admit = function (value) {\n var _this = this;\n if (isObjectOrArray(value)) {\n var original = this.passes.get(value);\n if (original)\n return original;\n var proto = Object.getPrototypeOf(value);\n switch (proto) {\n case Array.prototype: {\n if (this.known.has(value))\n return value;\n var array = value.map(this.admit, this);\n var node = this.pool.lookupArray(array);\n if (!node.array) {\n this.known.add(node.array = array);\n if (__DEV__) {\n Object.freeze(array);\n }\n }\n return node.array;\n }\n case null:\n case Object.prototype: {\n if (this.known.has(value))\n return value;\n var proto_1 = Object.getPrototypeOf(value);\n var array_1 = [proto_1];\n var keys = this.sortedKeys(value);\n array_1.push(keys.json);\n var firstValueIndex_1 = array_1.length;\n keys.sorted.forEach(function (key) {\n array_1.push(_this.admit(value[key]));\n });\n var node = this.pool.lookupArray(array_1);\n if (!node.object) {\n var obj_1 = node.object = Object.create(proto_1);\n this.known.add(obj_1);\n keys.sorted.forEach(function (key, i) {\n obj_1[key] = array_1[firstValueIndex_1 + i];\n });\n if (__DEV__) {\n Object.freeze(obj_1);\n }\n }\n return node.object;\n }\n }\n }\n return value;\n };\n ObjectCanon.prototype.sortedKeys = function (obj) {\n var keys = Object.keys(obj);\n var node = this.pool.lookupArray(keys);\n if (!node.keys) {\n keys.sort();\n var json = JSON.stringify(keys);\n if (!(node.keys = this.keysByJSON.get(json))) {\n this.keysByJSON.set(json, node.keys = { sorted: keys, json: json });\n }\n }\n return node.keys;\n };\n return ObjectCanon;\n}());\nexport { ObjectCanon };\nexport var canonicalStringify = Object.assign(function (value) {\n if (isObjectOrArray(value)) {\n if (stringifyCanon === void 0) {\n resetCanonicalStringify();\n }\n var canonical = stringifyCanon.admit(value);\n var json = stringifyCache.get(canonical);\n if (json === void 0) {\n stringifyCache.set(canonical, json = JSON.stringify(canonical));\n }\n return json;\n }\n return JSON.stringify(value);\n}, {\n reset: resetCanonicalStringify,\n});\nvar stringifyCanon;\nvar stringifyCache;\nfunction resetCanonicalStringify() {\n stringifyCanon = new ObjectCanon;\n stringifyCache = new (canUseWeakMap ? WeakMap : Map)();\n}\n//# sourceMappingURL=object-canon.js.map","import { __assign } from \"tslib\";\nimport { invariant, InvariantError } from \"../../utilities/globals/index.js\";\nimport { Kind, } from 'graphql';\nimport { wrap } from 'optimism';\nimport { isField, resultKeyNameFromField, isReference, makeReference, shouldInclude, addTypenameToDocument, getDefaultValues, getMainDefinition, getQueryDefinition, getFragmentFromSelection, maybeDeepFreeze, mergeDeepArray, DeepMerger, isNonNullObject, canUseWeakMap, compact, } from \"../../utilities/index.js\";\nimport { maybeDependOnExistenceOfEntity, supportsResultCaching } from \"./entityStore.js\";\nimport { isArray, extractFragmentContext, getTypenameFromStoreObject, shouldCanonizeResults } from \"./helpers.js\";\nimport { MissingFieldError } from \"../core/types/common.js\";\nimport { canonicalStringify, ObjectCanon } from \"./object-canon.js\";\n;\nfunction execSelectionSetKeyArgs(options) {\n return [\n options.selectionSet,\n options.objectOrReference,\n options.context,\n options.context.canonizeResults,\n ];\n}\nvar StoreReader = (function () {\n function StoreReader(config) {\n var _this = this;\n this.knownResults = new (canUseWeakMap ? WeakMap : Map)();\n this.config = compact(config, {\n addTypename: config.addTypename !== false,\n canonizeResults: shouldCanonizeResults(config),\n });\n this.canon = config.canon || new ObjectCanon;\n this.executeSelectionSet = wrap(function (options) {\n var _a;\n var canonizeResults = options.context.canonizeResults;\n var peekArgs = execSelectionSetKeyArgs(options);\n peekArgs[3] = !canonizeResults;\n var other = (_a = _this.executeSelectionSet).peek.apply(_a, peekArgs);\n if (other) {\n if (canonizeResults) {\n return __assign(__assign({}, other), { result: _this.canon.admit(other.result) });\n }\n return other;\n }\n maybeDependOnExistenceOfEntity(options.context.store, options.enclosingRef.__ref);\n return _this.execSelectionSetImpl(options);\n }, {\n max: this.config.resultCacheMaxSize,\n keyArgs: execSelectionSetKeyArgs,\n makeCacheKey: function (selectionSet, parent, context, canonizeResults) {\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(selectionSet, isReference(parent) ? parent.__ref : parent, context.varString, canonizeResults);\n }\n }\n });\n this.executeSubSelectedArray = wrap(function (options) {\n maybeDependOnExistenceOfEntity(options.context.store, options.enclosingRef.__ref);\n return _this.execSubSelectedArrayImpl(options);\n }, {\n max: this.config.resultCacheMaxSize,\n makeCacheKey: function (_a) {\n var field = _a.field, array = _a.array, context = _a.context;\n if (supportsResultCaching(context.store)) {\n return context.store.makeCacheKey(field, array, context.varString);\n }\n }\n });\n }\n StoreReader.prototype.resetCanon = function () {\n this.canon = new ObjectCanon;\n };\n StoreReader.prototype.diffQueryAgainstStore = function (_a) {\n var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? 'ROOT_QUERY' : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c, _d = _a.canonizeResults, canonizeResults = _d === void 0 ? this.config.canonizeResults : _d;\n var policies = this.config.cache.policies;\n variables = __assign(__assign({}, getDefaultValues(getQueryDefinition(query))), variables);\n var rootRef = makeReference(rootId);\n var execResult = this.executeSelectionSet({\n selectionSet: getMainDefinition(query).selectionSet,\n objectOrReference: rootRef,\n enclosingRef: rootRef,\n context: __assign({ store: store, query: query, policies: policies, variables: variables, varString: canonicalStringify(variables), canonizeResults: canonizeResults }, extractFragmentContext(query, this.config.fragments)),\n });\n var missing;\n if (execResult.missing) {\n missing = [new MissingFieldError(firstMissing(execResult.missing), execResult.missing, query, variables)];\n if (!returnPartialData) {\n throw missing[0];\n }\n }\n return {\n result: execResult.result,\n complete: !missing,\n missing: missing,\n };\n };\n StoreReader.prototype.isFresh = function (result, parent, selectionSet, context) {\n if (supportsResultCaching(context.store) &&\n this.knownResults.get(result) === selectionSet) {\n var latest = this.executeSelectionSet.peek(selectionSet, parent, context, this.canon.isKnown(result));\n if (latest && result === latest.result) {\n return true;\n }\n }\n return false;\n };\n StoreReader.prototype.execSelectionSetImpl = function (_a) {\n var _this = this;\n var selectionSet = _a.selectionSet, objectOrReference = _a.objectOrReference, enclosingRef = _a.enclosingRef, context = _a.context;\n if (isReference(objectOrReference) &&\n !context.policies.rootTypenamesById[objectOrReference.__ref] &&\n !context.store.has(objectOrReference.__ref)) {\n return {\n result: this.canon.empty,\n missing: \"Dangling reference to missing \".concat(objectOrReference.__ref, \" object\"),\n };\n }\n var variables = context.variables, policies = context.policies, store = context.store;\n var typename = store.getFieldValue(objectOrReference, \"__typename\");\n var objectsToMerge = [];\n var missing;\n var missingMerger = new DeepMerger();\n if (this.config.addTypename &&\n typeof typename === \"string\" &&\n !policies.rootIdsByTypename[typename]) {\n objectsToMerge.push({ __typename: typename });\n }\n function handleMissing(result, resultName) {\n var _a;\n if (result.missing) {\n missing = missingMerger.merge(missing, (_a = {}, _a[resultName] = result.missing, _a));\n }\n return result.result;\n }\n var workSet = new Set(selectionSet.selections);\n workSet.forEach(function (selection) {\n var _a, _b;\n if (!shouldInclude(selection, variables))\n return;\n if (isField(selection)) {\n var fieldValue = policies.readField({\n fieldName: selection.name.value,\n field: selection,\n variables: context.variables,\n from: objectOrReference,\n }, context);\n var resultName = resultKeyNameFromField(selection);\n if (fieldValue === void 0) {\n if (!addTypenameToDocument.added(selection)) {\n missing = missingMerger.merge(missing, (_a = {},\n _a[resultName] = \"Can't find field '\".concat(selection.name.value, \"' on \").concat(isReference(objectOrReference)\n ? objectOrReference.__ref + \" object\"\n : \"object \" + JSON.stringify(objectOrReference, null, 2)),\n _a));\n }\n }\n else if (isArray(fieldValue)) {\n fieldValue = handleMissing(_this.executeSubSelectedArray({\n field: selection,\n array: fieldValue,\n enclosingRef: enclosingRef,\n context: context,\n }), resultName);\n }\n else if (!selection.selectionSet) {\n if (context.canonizeResults) {\n fieldValue = _this.canon.pass(fieldValue);\n }\n }\n else if (fieldValue != null) {\n fieldValue = handleMissing(_this.executeSelectionSet({\n selectionSet: selection.selectionSet,\n objectOrReference: fieldValue,\n enclosingRef: isReference(fieldValue) ? fieldValue : enclosingRef,\n context: context,\n }), resultName);\n }\n if (fieldValue !== void 0) {\n objectsToMerge.push((_b = {}, _b[resultName] = fieldValue, _b));\n }\n }\n else {\n var fragment = getFragmentFromSelection(selection, context.lookupFragment);\n if (!fragment && selection.kind === Kind.FRAGMENT_SPREAD) {\n throw __DEV__ ? new InvariantError(\"No fragment named \".concat(selection.name.value)) : new InvariantError(5);\n }\n if (fragment && policies.fragmentMatches(fragment, typename)) {\n fragment.selectionSet.selections.forEach(workSet.add, workSet);\n }\n }\n });\n var result = mergeDeepArray(objectsToMerge);\n var finalResult = { result: result, missing: missing };\n var frozen = context.canonizeResults\n ? this.canon.admit(finalResult)\n : maybeDeepFreeze(finalResult);\n if (frozen.result) {\n this.knownResults.set(frozen.result, selectionSet);\n }\n return frozen;\n };\n StoreReader.prototype.execSubSelectedArrayImpl = function (_a) {\n var _this = this;\n var field = _a.field, array = _a.array, enclosingRef = _a.enclosingRef, context = _a.context;\n var missing;\n var missingMerger = new DeepMerger();\n function handleMissing(childResult, i) {\n var _a;\n if (childResult.missing) {\n missing = missingMerger.merge(missing, (_a = {}, _a[i] = childResult.missing, _a));\n }\n return childResult.result;\n }\n if (field.selectionSet) {\n array = array.filter(context.store.canRead);\n }\n array = array.map(function (item, i) {\n if (item === null) {\n return null;\n }\n if (isArray(item)) {\n return handleMissing(_this.executeSubSelectedArray({\n field: field,\n array: item,\n enclosingRef: enclosingRef,\n context: context,\n }), i);\n }\n if (field.selectionSet) {\n return handleMissing(_this.executeSelectionSet({\n selectionSet: field.selectionSet,\n objectOrReference: item,\n enclosingRef: isReference(item) ? item : enclosingRef,\n context: context,\n }), i);\n }\n if (__DEV__) {\n assertSelectionSetForIdValue(context.store, field, item);\n }\n return item;\n });\n return {\n result: context.canonizeResults ? this.canon.admit(array) : array,\n missing: missing,\n };\n };\n return StoreReader;\n}());\nexport { StoreReader };\nfunction firstMissing(tree) {\n try {\n JSON.stringify(tree, function (_, value) {\n if (typeof value === \"string\")\n throw value;\n return value;\n });\n }\n catch (result) {\n return result;\n }\n}\nfunction assertSelectionSetForIdValue(store, field, fieldValue) {\n if (!field.selectionSet) {\n var workSet_1 = new Set([fieldValue]);\n workSet_1.forEach(function (value) {\n if (isNonNullObject(value)) {\n __DEV__ ? invariant(!isReference(value), \"Missing selection set for object of type \".concat(getTypenameFromStoreObject(store, value), \" returned for query field \").concat(field.name.value)) : invariant(!isReference(value), 6);\n Object.values(value).forEach(workSet_1.add, workSet_1);\n }\n });\n }\n}\n//# sourceMappingURL=readFromStore.js.map","import { dep } from \"optimism\";\nimport { Slot } from \"@wry/context\";\nexport var cacheSlot = new Slot();\nvar cacheInfoMap = new WeakMap();\nfunction getCacheInfo(cache) {\n var info = cacheInfoMap.get(cache);\n if (!info) {\n cacheInfoMap.set(cache, info = {\n vars: new Set,\n dep: dep(),\n });\n }\n return info;\n}\nexport function forgetCache(cache) {\n getCacheInfo(cache).vars.forEach(function (rv) { return rv.forgetCache(cache); });\n}\nexport function recallCache(cache) {\n getCacheInfo(cache).vars.forEach(function (rv) { return rv.attachCache(cache); });\n}\nexport function makeVar(value) {\n var caches = new Set();\n var listeners = new Set();\n var rv = function (newValue) {\n if (arguments.length > 0) {\n if (value !== newValue) {\n value = newValue;\n caches.forEach(function (cache) {\n getCacheInfo(cache).dep.dirty(rv);\n broadcast(cache);\n });\n var oldListeners = Array.from(listeners);\n listeners.clear();\n oldListeners.forEach(function (listener) { return listener(value); });\n }\n }\n else {\n var cache = cacheSlot.getValue();\n if (cache) {\n attach(cache);\n getCacheInfo(cache).dep(rv);\n }\n }\n return value;\n };\n rv.onNextChange = function (listener) {\n listeners.add(listener);\n return function () {\n listeners.delete(listener);\n };\n };\n var attach = rv.attachCache = function (cache) {\n caches.add(cache);\n getCacheInfo(cache).vars.add(rv);\n return rv;\n };\n rv.forgetCache = function (cache) { return caches.delete(cache); };\n return rv;\n}\nfunction broadcast(cache) {\n if (cache.broadcastWatches) {\n cache.broadcastWatches();\n }\n}\n//# sourceMappingURL=reactiveVars.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport { argumentsObjectFromField, DeepMerger, isNonEmptyArray, isNonNullObject, } from \"../../utilities/index.js\";\nimport { hasOwn, isArray } from \"./helpers.js\";\nvar specifierInfoCache = Object.create(null);\nfunction lookupSpecifierInfo(spec) {\n var cacheKey = JSON.stringify(spec);\n return specifierInfoCache[cacheKey] ||\n (specifierInfoCache[cacheKey] = Object.create(null));\n}\nexport function keyFieldsFnFromSpecifier(specifier) {\n var info = lookupSpecifierInfo(specifier);\n return info.keyFieldsFn || (info.keyFieldsFn = function (object, context) {\n var extract = function (from, key) { return context.readField(key, from); };\n var keyObject = context.keyObject = collectSpecifierPaths(specifier, function (schemaKeyPath) {\n var extracted = extractKeyPath(context.storeObject, schemaKeyPath, extract);\n if (extracted === void 0 &&\n object !== context.storeObject &&\n hasOwn.call(object, schemaKeyPath[0])) {\n extracted = extractKeyPath(object, schemaKeyPath, extractKey);\n }\n __DEV__ ? invariant(extracted !== void 0, \"Missing field '\".concat(schemaKeyPath.join('.'), \"' while extracting keyFields from \").concat(JSON.stringify(object))) : invariant(extracted !== void 0, 2);\n return extracted;\n });\n return \"\".concat(context.typename, \":\").concat(JSON.stringify(keyObject));\n });\n}\nexport function keyArgsFnFromSpecifier(specifier) {\n var info = lookupSpecifierInfo(specifier);\n return info.keyArgsFn || (info.keyArgsFn = function (args, _a) {\n var field = _a.field, variables = _a.variables, fieldName = _a.fieldName;\n var collected = collectSpecifierPaths(specifier, function (keyPath) {\n var firstKey = keyPath[0];\n var firstChar = firstKey.charAt(0);\n if (firstChar === \"@\") {\n if (field && isNonEmptyArray(field.directives)) {\n var directiveName_1 = firstKey.slice(1);\n var d = field.directives.find(function (d) { return d.name.value === directiveName_1; });\n var directiveArgs = d && argumentsObjectFromField(d, variables);\n return directiveArgs && extractKeyPath(directiveArgs, keyPath.slice(1));\n }\n return;\n }\n if (firstChar === \"$\") {\n var variableName = firstKey.slice(1);\n if (variables && hasOwn.call(variables, variableName)) {\n var varKeyPath = keyPath.slice(0);\n varKeyPath[0] = variableName;\n return extractKeyPath(variables, varKeyPath);\n }\n return;\n }\n if (args) {\n return extractKeyPath(args, keyPath);\n }\n });\n var suffix = JSON.stringify(collected);\n if (args || suffix !== \"{}\") {\n fieldName += \":\" + suffix;\n }\n return fieldName;\n });\n}\nexport function collectSpecifierPaths(specifier, extractor) {\n var merger = new DeepMerger;\n return getSpecifierPaths(specifier).reduce(function (collected, path) {\n var _a;\n var toMerge = extractor(path);\n if (toMerge !== void 0) {\n for (var i = path.length - 1; i >= 0; --i) {\n toMerge = (_a = {}, _a[path[i]] = toMerge, _a);\n }\n collected = merger.merge(collected, toMerge);\n }\n return collected;\n }, Object.create(null));\n}\nexport function getSpecifierPaths(spec) {\n var info = lookupSpecifierInfo(spec);\n if (!info.paths) {\n var paths_1 = info.paths = [];\n var currentPath_1 = [];\n spec.forEach(function (s, i) {\n if (isArray(s)) {\n getSpecifierPaths(s).forEach(function (p) { return paths_1.push(currentPath_1.concat(p)); });\n currentPath_1.length = 0;\n }\n else {\n currentPath_1.push(s);\n if (!isArray(spec[i + 1])) {\n paths_1.push(currentPath_1.slice(0));\n currentPath_1.length = 0;\n }\n }\n });\n }\n return info.paths;\n}\nfunction extractKey(object, key) {\n return object[key];\n}\nexport function extractKeyPath(object, path, extract) {\n extract = extract || extractKey;\n return normalize(path.reduce(function reducer(obj, key) {\n return isArray(obj)\n ? obj.map(function (child) { return reducer(child, key); })\n : obj && extract(obj, key);\n }, object));\n}\nfunction normalize(value) {\n if (isNonNullObject(value)) {\n if (isArray(value)) {\n return value.map(normalize);\n }\n return collectSpecifierPaths(Object.keys(value).sort(), function (path) { return extractKeyPath(value, path); });\n }\n return value;\n}\n//# sourceMappingURL=key-extractor.js.map","import { __assign, __rest } from \"tslib\";\nimport { invariant, InvariantError } from \"../../utilities/globals/index.js\";\nimport { storeKeyNameFromField, argumentsObjectFromField, isReference, getStoreKeyName, isNonNullObject, stringifyForDisplay, } from \"../../utilities/index.js\";\nimport { hasOwn, fieldNameFromStoreName, storeValueIsStoreObject, selectionSetMatchesResult, TypeOrFieldNameRegExp, defaultDataIdFromObject, isArray, } from \"./helpers.js\";\nimport { cacheSlot } from \"./reactiveVars.js\";\nimport { canonicalStringify } from \"./object-canon.js\";\nimport { keyArgsFnFromSpecifier, keyFieldsFnFromSpecifier } from \"./key-extractor.js\";\ngetStoreKeyName.setStringify(canonicalStringify);\nfunction argsFromFieldSpecifier(spec) {\n return spec.args !== void 0 ? spec.args :\n spec.field ? argumentsObjectFromField(spec.field, spec.variables) : null;\n}\nvar nullKeyFieldsFn = function () { return void 0; };\nvar simpleKeyArgsFn = function (_args, context) { return context.fieldName; };\nvar mergeTrueFn = function (existing, incoming, _a) {\n var mergeObjects = _a.mergeObjects;\n return mergeObjects(existing, incoming);\n};\nvar mergeFalseFn = function (_, incoming) { return incoming; };\nvar Policies = (function () {\n function Policies(config) {\n this.config = config;\n this.typePolicies = Object.create(null);\n this.toBeAdded = Object.create(null);\n this.supertypeMap = new Map();\n this.fuzzySubtypes = new Map();\n this.rootIdsByTypename = Object.create(null);\n this.rootTypenamesById = Object.create(null);\n this.usingPossibleTypes = false;\n this.config = __assign({ dataIdFromObject: defaultDataIdFromObject }, config);\n this.cache = this.config.cache;\n this.setRootTypename(\"Query\");\n this.setRootTypename(\"Mutation\");\n this.setRootTypename(\"Subscription\");\n if (config.possibleTypes) {\n this.addPossibleTypes(config.possibleTypes);\n }\n if (config.typePolicies) {\n this.addTypePolicies(config.typePolicies);\n }\n }\n Policies.prototype.identify = function (object, partialContext) {\n var _a;\n var policies = this;\n var typename = partialContext && (partialContext.typename ||\n ((_a = partialContext.storeObject) === null || _a === void 0 ? void 0 : _a.__typename)) || object.__typename;\n if (typename === this.rootTypenamesById.ROOT_QUERY) {\n return [\"ROOT_QUERY\"];\n }\n var storeObject = partialContext && partialContext.storeObject || object;\n var context = __assign(__assign({}, partialContext), { typename: typename, storeObject: storeObject, readField: partialContext && partialContext.readField || function () {\n var options = normalizeReadFieldOptions(arguments, storeObject);\n return policies.readField(options, {\n store: policies.cache[\"data\"],\n variables: options.variables,\n });\n } });\n var id;\n var policy = typename && this.getTypePolicy(typename);\n var keyFn = policy && policy.keyFn || this.config.dataIdFromObject;\n while (keyFn) {\n var specifierOrId = keyFn(__assign(__assign({}, object), storeObject), context);\n if (isArray(specifierOrId)) {\n keyFn = keyFieldsFnFromSpecifier(specifierOrId);\n }\n else {\n id = specifierOrId;\n break;\n }\n }\n id = id ? String(id) : void 0;\n return context.keyObject ? [id, context.keyObject] : [id];\n };\n Policies.prototype.addTypePolicies = function (typePolicies) {\n var _this = this;\n Object.keys(typePolicies).forEach(function (typename) {\n var _a = typePolicies[typename], queryType = _a.queryType, mutationType = _a.mutationType, subscriptionType = _a.subscriptionType, incoming = __rest(_a, [\"queryType\", \"mutationType\", \"subscriptionType\"]);\n if (queryType)\n _this.setRootTypename(\"Query\", typename);\n if (mutationType)\n _this.setRootTypename(\"Mutation\", typename);\n if (subscriptionType)\n _this.setRootTypename(\"Subscription\", typename);\n if (hasOwn.call(_this.toBeAdded, typename)) {\n _this.toBeAdded[typename].push(incoming);\n }\n else {\n _this.toBeAdded[typename] = [incoming];\n }\n });\n };\n Policies.prototype.updateTypePolicy = function (typename, incoming) {\n var _this = this;\n var existing = this.getTypePolicy(typename);\n var keyFields = incoming.keyFields, fields = incoming.fields;\n function setMerge(existing, merge) {\n existing.merge =\n typeof merge === \"function\" ? merge :\n merge === true ? mergeTrueFn :\n merge === false ? mergeFalseFn :\n existing.merge;\n }\n setMerge(existing, incoming.merge);\n existing.keyFn =\n keyFields === false ? nullKeyFieldsFn :\n isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :\n typeof keyFields === \"function\" ? keyFields :\n existing.keyFn;\n if (fields) {\n Object.keys(fields).forEach(function (fieldName) {\n var existing = _this.getFieldPolicy(typename, fieldName, true);\n var incoming = fields[fieldName];\n if (typeof incoming === \"function\") {\n existing.read = incoming;\n }\n else {\n var keyArgs = incoming.keyArgs, read = incoming.read, merge = incoming.merge;\n existing.keyFn =\n keyArgs === false ? simpleKeyArgsFn :\n isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) :\n typeof keyArgs === \"function\" ? keyArgs :\n existing.keyFn;\n if (typeof read === \"function\") {\n existing.read = read;\n }\n setMerge(existing, merge);\n }\n if (existing.read && existing.merge) {\n existing.keyFn = existing.keyFn || simpleKeyArgsFn;\n }\n });\n }\n };\n Policies.prototype.setRootTypename = function (which, typename) {\n if (typename === void 0) { typename = which; }\n var rootId = \"ROOT_\" + which.toUpperCase();\n var old = this.rootTypenamesById[rootId];\n if (typename !== old) {\n __DEV__ ? invariant(!old || old === which, \"Cannot change root \".concat(which, \" __typename more than once\")) : invariant(!old || old === which, 3);\n if (old)\n delete this.rootIdsByTypename[old];\n this.rootIdsByTypename[typename] = rootId;\n this.rootTypenamesById[rootId] = typename;\n }\n };\n Policies.prototype.addPossibleTypes = function (possibleTypes) {\n var _this = this;\n this.usingPossibleTypes = true;\n Object.keys(possibleTypes).forEach(function (supertype) {\n _this.getSupertypeSet(supertype, true);\n possibleTypes[supertype].forEach(function (subtype) {\n _this.getSupertypeSet(subtype, true).add(supertype);\n var match = subtype.match(TypeOrFieldNameRegExp);\n if (!match || match[0] !== subtype) {\n _this.fuzzySubtypes.set(subtype, new RegExp(subtype));\n }\n });\n });\n };\n Policies.prototype.getTypePolicy = function (typename) {\n var _this = this;\n if (!hasOwn.call(this.typePolicies, typename)) {\n var policy_1 = this.typePolicies[typename] = Object.create(null);\n policy_1.fields = Object.create(null);\n var supertypes = this.supertypeMap.get(typename);\n if (supertypes && supertypes.size) {\n supertypes.forEach(function (supertype) {\n var _a = _this.getTypePolicy(supertype), fields = _a.fields, rest = __rest(_a, [\"fields\"]);\n Object.assign(policy_1, rest);\n Object.assign(policy_1.fields, fields);\n });\n }\n }\n var inbox = this.toBeAdded[typename];\n if (inbox && inbox.length) {\n inbox.splice(0).forEach(function (policy) {\n _this.updateTypePolicy(typename, policy);\n });\n }\n return this.typePolicies[typename];\n };\n Policies.prototype.getFieldPolicy = function (typename, fieldName, createIfMissing) {\n if (typename) {\n var fieldPolicies = this.getTypePolicy(typename).fields;\n return fieldPolicies[fieldName] || (createIfMissing && (fieldPolicies[fieldName] = Object.create(null)));\n }\n };\n Policies.prototype.getSupertypeSet = function (subtype, createIfMissing) {\n var supertypeSet = this.supertypeMap.get(subtype);\n if (!supertypeSet && createIfMissing) {\n this.supertypeMap.set(subtype, supertypeSet = new Set());\n }\n return supertypeSet;\n };\n Policies.prototype.fragmentMatches = function (fragment, typename, result, variables) {\n var _this = this;\n if (!fragment.typeCondition)\n return true;\n if (!typename)\n return false;\n var supertype = fragment.typeCondition.name.value;\n if (typename === supertype)\n return true;\n if (this.usingPossibleTypes &&\n this.supertypeMap.has(supertype)) {\n var typenameSupertypeSet = this.getSupertypeSet(typename, true);\n var workQueue_1 = [typenameSupertypeSet];\n var maybeEnqueue_1 = function (subtype) {\n var supertypeSet = _this.getSupertypeSet(subtype, false);\n if (supertypeSet &&\n supertypeSet.size &&\n workQueue_1.indexOf(supertypeSet) < 0) {\n workQueue_1.push(supertypeSet);\n }\n };\n var needToCheckFuzzySubtypes = !!(result && this.fuzzySubtypes.size);\n var checkingFuzzySubtypes = false;\n for (var i = 0; i < workQueue_1.length; ++i) {\n var supertypeSet = workQueue_1[i];\n if (supertypeSet.has(supertype)) {\n if (!typenameSupertypeSet.has(supertype)) {\n if (checkingFuzzySubtypes) {\n __DEV__ && invariant.warn(\"Inferring subtype \".concat(typename, \" of supertype \").concat(supertype));\n }\n typenameSupertypeSet.add(supertype);\n }\n return true;\n }\n supertypeSet.forEach(maybeEnqueue_1);\n if (needToCheckFuzzySubtypes &&\n i === workQueue_1.length - 1 &&\n selectionSetMatchesResult(fragment.selectionSet, result, variables)) {\n needToCheckFuzzySubtypes = false;\n checkingFuzzySubtypes = true;\n this.fuzzySubtypes.forEach(function (regExp, fuzzyString) {\n var match = typename.match(regExp);\n if (match && match[0] === typename) {\n maybeEnqueue_1(fuzzyString);\n }\n });\n }\n }\n }\n return false;\n };\n Policies.prototype.hasKeyArgs = function (typename, fieldName) {\n var policy = this.getFieldPolicy(typename, fieldName, false);\n return !!(policy && policy.keyFn);\n };\n Policies.prototype.getStoreFieldName = function (fieldSpec) {\n var typename = fieldSpec.typename, fieldName = fieldSpec.fieldName;\n var policy = this.getFieldPolicy(typename, fieldName, false);\n var storeFieldName;\n var keyFn = policy && policy.keyFn;\n if (keyFn && typename) {\n var context = {\n typename: typename,\n fieldName: fieldName,\n field: fieldSpec.field || null,\n variables: fieldSpec.variables,\n };\n var args = argsFromFieldSpecifier(fieldSpec);\n while (keyFn) {\n var specifierOrString = keyFn(args, context);\n if (isArray(specifierOrString)) {\n keyFn = keyArgsFnFromSpecifier(specifierOrString);\n }\n else {\n storeFieldName = specifierOrString || fieldName;\n break;\n }\n }\n }\n if (storeFieldName === void 0) {\n storeFieldName = fieldSpec.field\n ? storeKeyNameFromField(fieldSpec.field, fieldSpec.variables)\n : getStoreKeyName(fieldName, argsFromFieldSpecifier(fieldSpec));\n }\n if (storeFieldName === false) {\n return fieldName;\n }\n return fieldName === fieldNameFromStoreName(storeFieldName)\n ? storeFieldName\n : fieldName + \":\" + storeFieldName;\n };\n Policies.prototype.readField = function (options, context) {\n var objectOrReference = options.from;\n if (!objectOrReference)\n return;\n var nameOrField = options.field || options.fieldName;\n if (!nameOrField)\n return;\n if (options.typename === void 0) {\n var typename = context.store.getFieldValue(objectOrReference, \"__typename\");\n if (typename)\n options.typename = typename;\n }\n var storeFieldName = this.getStoreFieldName(options);\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var existing = context.store.getFieldValue(objectOrReference, storeFieldName);\n var policy = this.getFieldPolicy(options.typename, fieldName, false);\n var read = policy && policy.read;\n if (read) {\n var readOptions = makeFieldFunctionOptions(this, objectOrReference, options, context, context.store.getStorage(isReference(objectOrReference)\n ? objectOrReference.__ref\n : objectOrReference, storeFieldName));\n return cacheSlot.withValue(this.cache, read, [existing, readOptions]);\n }\n return existing;\n };\n Policies.prototype.getReadFunction = function (typename, fieldName) {\n var policy = this.getFieldPolicy(typename, fieldName, false);\n return policy && policy.read;\n };\n Policies.prototype.getMergeFunction = function (parentTypename, fieldName, childTypename) {\n var policy = this.getFieldPolicy(parentTypename, fieldName, false);\n var merge = policy && policy.merge;\n if (!merge && childTypename) {\n policy = this.getTypePolicy(childTypename);\n merge = policy && policy.merge;\n }\n return merge;\n };\n Policies.prototype.runMergeFunction = function (existing, incoming, _a, context, storage) {\n var field = _a.field, typename = _a.typename, merge = _a.merge;\n if (merge === mergeTrueFn) {\n return makeMergeObjectsFunction(context.store)(existing, incoming);\n }\n if (merge === mergeFalseFn) {\n return incoming;\n }\n if (context.overwrite) {\n existing = void 0;\n }\n return merge(existing, incoming, makeFieldFunctionOptions(this, void 0, { typename: typename, fieldName: field.name.value, field: field, variables: context.variables }, context, storage || Object.create(null)));\n };\n return Policies;\n}());\nexport { Policies };\nfunction makeFieldFunctionOptions(policies, objectOrReference, fieldSpec, context, storage) {\n var storeFieldName = policies.getStoreFieldName(fieldSpec);\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var variables = fieldSpec.variables || context.variables;\n var _a = context.store, toReference = _a.toReference, canRead = _a.canRead;\n return {\n args: argsFromFieldSpecifier(fieldSpec),\n field: fieldSpec.field || null,\n fieldName: fieldName,\n storeFieldName: storeFieldName,\n variables: variables,\n isReference: isReference,\n toReference: toReference,\n storage: storage,\n cache: policies.cache,\n canRead: canRead,\n readField: function () {\n return policies.readField(normalizeReadFieldOptions(arguments, objectOrReference, variables), context);\n },\n mergeObjects: makeMergeObjectsFunction(context.store),\n };\n}\nexport function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables) {\n var fieldNameOrOptions = readFieldArgs[0], from = readFieldArgs[1], argc = readFieldArgs.length;\n var options;\n if (typeof fieldNameOrOptions === \"string\") {\n options = {\n fieldName: fieldNameOrOptions,\n from: argc > 1 ? from : objectOrReference,\n };\n }\n else {\n options = __assign({}, fieldNameOrOptions);\n if (!hasOwn.call(options, \"from\")) {\n options.from = objectOrReference;\n }\n }\n if (__DEV__ && options.from === void 0) {\n __DEV__ && invariant.warn(\"Undefined 'from' passed to readField with arguments \".concat(stringifyForDisplay(Array.from(readFieldArgs))));\n }\n if (void 0 === options.variables) {\n options.variables = variables;\n }\n return options;\n}\nfunction makeMergeObjectsFunction(store) {\n return function mergeObjects(existing, incoming) {\n if (isArray(existing) || isArray(incoming)) {\n throw __DEV__ ? new InvariantError(\"Cannot automatically merge arrays\") : new InvariantError(4);\n }\n if (isNonNullObject(existing) &&\n isNonNullObject(incoming)) {\n var eType = store.getFieldValue(existing, \"__typename\");\n var iType = store.getFieldValue(incoming, \"__typename\");\n var typesDiffer = eType && iType && eType !== iType;\n if (typesDiffer) {\n return incoming;\n }\n if (isReference(existing) &&\n storeValueIsStoreObject(incoming)) {\n store.merge(existing.__ref, incoming);\n return existing;\n }\n if (storeValueIsStoreObject(existing) &&\n isReference(incoming)) {\n store.merge(existing, incoming.__ref);\n return incoming;\n }\n if (storeValueIsStoreObject(existing) &&\n storeValueIsStoreObject(incoming)) {\n return __assign(__assign({}, existing), incoming);\n }\n }\n return incoming;\n };\n}\n//# sourceMappingURL=policies.js.map","import { __assign } from \"tslib\";\nimport { invariant, InvariantError } from \"../../utilities/globals/index.js\";\nimport { equal } from '@wry/equality';\nimport { Trie } from '@wry/trie';\nimport { Kind, } from 'graphql';\nimport { getFragmentFromSelection, getDefaultValues, getOperationDefinition, getTypenameFromResult, makeReference, isField, resultKeyNameFromField, isReference, shouldInclude, cloneDeep, addTypenameToDocument, isNonEmptyArray, argumentsObjectFromField, } from \"../../utilities/index.js\";\nimport { isArray, makeProcessedFieldsMerger, fieldNameFromStoreName, storeValueIsStoreObject, extractFragmentContext } from \"./helpers.js\";\nimport { canonicalStringify } from \"./object-canon.js\";\nimport { normalizeReadFieldOptions } from \"./policies.js\";\n;\nfunction getContextFlavor(context, clientOnly, deferred) {\n var key = \"\".concat(clientOnly).concat(deferred);\n var flavored = context.flavors.get(key);\n if (!flavored) {\n context.flavors.set(key, flavored = (context.clientOnly === clientOnly &&\n context.deferred === deferred) ? context : __assign(__assign({}, context), { clientOnly: clientOnly, deferred: deferred }));\n }\n return flavored;\n}\nvar StoreWriter = (function () {\n function StoreWriter(cache, reader, fragments) {\n this.cache = cache;\n this.reader = reader;\n this.fragments = fragments;\n }\n StoreWriter.prototype.writeToStore = function (store, _a) {\n var _this = this;\n var query = _a.query, result = _a.result, dataId = _a.dataId, variables = _a.variables, overwrite = _a.overwrite;\n var operationDefinition = getOperationDefinition(query);\n var merger = makeProcessedFieldsMerger();\n variables = __assign(__assign({}, getDefaultValues(operationDefinition)), variables);\n var context = __assign(__assign({ store: store, written: Object.create(null), merge: function (existing, incoming) {\n return merger.merge(existing, incoming);\n }, variables: variables, varString: canonicalStringify(variables) }, extractFragmentContext(query, this.fragments)), { overwrite: !!overwrite, incomingById: new Map, clientOnly: false, deferred: false, flavors: new Map });\n var ref = this.processSelectionSet({\n result: result || Object.create(null),\n dataId: dataId,\n selectionSet: operationDefinition.selectionSet,\n mergeTree: { map: new Map },\n context: context,\n });\n if (!isReference(ref)) {\n throw __DEV__ ? new InvariantError(\"Could not identify object \".concat(JSON.stringify(result))) : new InvariantError(7);\n }\n context.incomingById.forEach(function (_a, dataId) {\n var storeObject = _a.storeObject, mergeTree = _a.mergeTree, fieldNodeSet = _a.fieldNodeSet;\n var entityRef = makeReference(dataId);\n if (mergeTree && mergeTree.map.size) {\n var applied = _this.applyMerges(mergeTree, entityRef, storeObject, context);\n if (isReference(applied)) {\n return;\n }\n storeObject = applied;\n }\n if (__DEV__ && !context.overwrite) {\n var fieldsWithSelectionSets_1 = Object.create(null);\n fieldNodeSet.forEach(function (field) {\n if (field.selectionSet) {\n fieldsWithSelectionSets_1[field.name.value] = true;\n }\n });\n var hasSelectionSet_1 = function (storeFieldName) {\n return fieldsWithSelectionSets_1[fieldNameFromStoreName(storeFieldName)] === true;\n };\n var hasMergeFunction_1 = function (storeFieldName) {\n var childTree = mergeTree && mergeTree.map.get(storeFieldName);\n return Boolean(childTree && childTree.info && childTree.info.merge);\n };\n Object.keys(storeObject).forEach(function (storeFieldName) {\n if (hasSelectionSet_1(storeFieldName) &&\n !hasMergeFunction_1(storeFieldName)) {\n warnAboutDataLoss(entityRef, storeObject, storeFieldName, context.store);\n }\n });\n }\n store.merge(dataId, storeObject);\n });\n store.retain(ref.__ref);\n return ref;\n };\n StoreWriter.prototype.processSelectionSet = function (_a) {\n var _this = this;\n var dataId = _a.dataId, result = _a.result, selectionSet = _a.selectionSet, context = _a.context, mergeTree = _a.mergeTree;\n var policies = this.cache.policies;\n var incoming = Object.create(null);\n var typename = (dataId && policies.rootTypenamesById[dataId]) ||\n getTypenameFromResult(result, selectionSet, context.fragmentMap) ||\n (dataId && context.store.get(dataId, \"__typename\"));\n if (\"string\" === typeof typename) {\n incoming.__typename = typename;\n }\n var readField = function () {\n var options = normalizeReadFieldOptions(arguments, incoming, context.variables);\n if (isReference(options.from)) {\n var info = context.incomingById.get(options.from.__ref);\n if (info) {\n var result_1 = policies.readField(__assign(__assign({}, options), { from: info.storeObject }), context);\n if (result_1 !== void 0) {\n return result_1;\n }\n }\n }\n return policies.readField(options, context);\n };\n var fieldNodeSet = new Set();\n this.flattenFields(selectionSet, result, context, typename).forEach(function (context, field) {\n var _a;\n var resultFieldKey = resultKeyNameFromField(field);\n var value = result[resultFieldKey];\n fieldNodeSet.add(field);\n if (value !== void 0) {\n var storeFieldName = policies.getStoreFieldName({\n typename: typename,\n fieldName: field.name.value,\n field: field,\n variables: context.variables,\n });\n var childTree = getChildMergeTree(mergeTree, storeFieldName);\n var incomingValue = _this.processFieldValue(value, field, field.selectionSet\n ? getContextFlavor(context, false, false)\n : context, childTree);\n var childTypename = void 0;\n if (field.selectionSet &&\n (isReference(incomingValue) ||\n storeValueIsStoreObject(incomingValue))) {\n childTypename = readField(\"__typename\", incomingValue);\n }\n var merge = policies.getMergeFunction(typename, field.name.value, childTypename);\n if (merge) {\n childTree.info = {\n field: field,\n typename: typename,\n merge: merge,\n };\n }\n else {\n maybeRecycleChildMergeTree(mergeTree, storeFieldName);\n }\n incoming = context.merge(incoming, (_a = {},\n _a[storeFieldName] = incomingValue,\n _a));\n }\n else if (__DEV__ &&\n !context.clientOnly &&\n !context.deferred &&\n !addTypenameToDocument.added(field) &&\n !policies.getReadFunction(typename, field.name.value)) {\n __DEV__ && invariant.error(\"Missing field '\".concat(resultKeyNameFromField(field), \"' while writing result \").concat(JSON.stringify(result, null, 2)).substring(0, 1000));\n }\n });\n try {\n var _b = policies.identify(result, {\n typename: typename,\n selectionSet: selectionSet,\n fragmentMap: context.fragmentMap,\n storeObject: incoming,\n readField: readField,\n }), id = _b[0], keyObject = _b[1];\n dataId = dataId || id;\n if (keyObject) {\n incoming = context.merge(incoming, keyObject);\n }\n }\n catch (e) {\n if (!dataId)\n throw e;\n }\n if (\"string\" === typeof dataId) {\n var dataRef = makeReference(dataId);\n var sets = context.written[dataId] || (context.written[dataId] = []);\n if (sets.indexOf(selectionSet) >= 0)\n return dataRef;\n sets.push(selectionSet);\n if (this.reader && this.reader.isFresh(result, dataRef, selectionSet, context)) {\n return dataRef;\n }\n var previous_1 = context.incomingById.get(dataId);\n if (previous_1) {\n previous_1.storeObject = context.merge(previous_1.storeObject, incoming);\n previous_1.mergeTree = mergeMergeTrees(previous_1.mergeTree, mergeTree);\n fieldNodeSet.forEach(function (field) { return previous_1.fieldNodeSet.add(field); });\n }\n else {\n context.incomingById.set(dataId, {\n storeObject: incoming,\n mergeTree: mergeTreeIsEmpty(mergeTree) ? void 0 : mergeTree,\n fieldNodeSet: fieldNodeSet,\n });\n }\n return dataRef;\n }\n return incoming;\n };\n StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {\n var _this = this;\n if (!field.selectionSet || value === null) {\n return __DEV__ ? cloneDeep(value) : value;\n }\n if (isArray(value)) {\n return value.map(function (item, i) {\n var value = _this.processFieldValue(item, field, context, getChildMergeTree(mergeTree, i));\n maybeRecycleChildMergeTree(mergeTree, i);\n return value;\n });\n }\n return this.processSelectionSet({\n result: value,\n selectionSet: field.selectionSet,\n context: context,\n mergeTree: mergeTree,\n });\n };\n StoreWriter.prototype.flattenFields = function (selectionSet, result, context, typename) {\n if (typename === void 0) { typename = getTypenameFromResult(result, selectionSet, context.fragmentMap); }\n var fieldMap = new Map();\n var policies = this.cache.policies;\n var limitingTrie = new Trie(false);\n (function flatten(selectionSet, inheritedContext) {\n var visitedNode = limitingTrie.lookup(selectionSet, inheritedContext.clientOnly, inheritedContext.deferred);\n if (visitedNode.visited)\n return;\n visitedNode.visited = true;\n selectionSet.selections.forEach(function (selection) {\n if (!shouldInclude(selection, context.variables))\n return;\n var clientOnly = inheritedContext.clientOnly, deferred = inheritedContext.deferred;\n if (!(clientOnly && deferred) &&\n isNonEmptyArray(selection.directives)) {\n selection.directives.forEach(function (dir) {\n var name = dir.name.value;\n if (name === \"client\")\n clientOnly = true;\n if (name === \"defer\") {\n var args = argumentsObjectFromField(dir, context.variables);\n if (!args || args.if !== false) {\n deferred = true;\n }\n }\n });\n }\n if (isField(selection)) {\n var existing = fieldMap.get(selection);\n if (existing) {\n clientOnly = clientOnly && existing.clientOnly;\n deferred = deferred && existing.deferred;\n }\n fieldMap.set(selection, getContextFlavor(context, clientOnly, deferred));\n }\n else {\n var fragment = getFragmentFromSelection(selection, context.lookupFragment);\n if (!fragment && selection.kind === Kind.FRAGMENT_SPREAD) {\n throw __DEV__ ? new InvariantError(\"No fragment named \".concat(selection.name.value)) : new InvariantError(8);\n }\n if (fragment &&\n policies.fragmentMatches(fragment, typename, result, context.variables)) {\n flatten(fragment.selectionSet, getContextFlavor(context, clientOnly, deferred));\n }\n }\n });\n })(selectionSet, context);\n return fieldMap;\n };\n StoreWriter.prototype.applyMerges = function (mergeTree, existing, incoming, context, getStorageArgs) {\n var _a;\n var _this = this;\n if (mergeTree.map.size && !isReference(incoming)) {\n var e_1 = (!isArray(incoming) &&\n (isReference(existing) || storeValueIsStoreObject(existing))) ? existing : void 0;\n var i_1 = incoming;\n if (e_1 && !getStorageArgs) {\n getStorageArgs = [isReference(e_1) ? e_1.__ref : e_1];\n }\n var changedFields_1;\n var getValue_1 = function (from, name) {\n return isArray(from)\n ? (typeof name === \"number\" ? from[name] : void 0)\n : context.store.getFieldValue(from, String(name));\n };\n mergeTree.map.forEach(function (childTree, storeFieldName) {\n var eVal = getValue_1(e_1, storeFieldName);\n var iVal = getValue_1(i_1, storeFieldName);\n if (void 0 === iVal)\n return;\n if (getStorageArgs) {\n getStorageArgs.push(storeFieldName);\n }\n var aVal = _this.applyMerges(childTree, eVal, iVal, context, getStorageArgs);\n if (aVal !== iVal) {\n changedFields_1 = changedFields_1 || new Map;\n changedFields_1.set(storeFieldName, aVal);\n }\n if (getStorageArgs) {\n invariant(getStorageArgs.pop() === storeFieldName);\n }\n });\n if (changedFields_1) {\n incoming = (isArray(i_1) ? i_1.slice(0) : __assign({}, i_1));\n changedFields_1.forEach(function (value, name) {\n incoming[name] = value;\n });\n }\n }\n if (mergeTree.info) {\n return this.cache.policies.runMergeFunction(existing, incoming, mergeTree.info, context, getStorageArgs && (_a = context.store).getStorage.apply(_a, getStorageArgs));\n }\n return incoming;\n };\n return StoreWriter;\n}());\nexport { StoreWriter };\nvar emptyMergeTreePool = [];\nfunction getChildMergeTree(_a, name) {\n var map = _a.map;\n if (!map.has(name)) {\n map.set(name, emptyMergeTreePool.pop() || { map: new Map });\n }\n return map.get(name);\n}\nfunction mergeMergeTrees(left, right) {\n if (left === right || !right || mergeTreeIsEmpty(right))\n return left;\n if (!left || mergeTreeIsEmpty(left))\n return right;\n var info = left.info && right.info ? __assign(__assign({}, left.info), right.info) : left.info || right.info;\n var needToMergeMaps = left.map.size && right.map.size;\n var map = needToMergeMaps ? new Map :\n left.map.size ? left.map : right.map;\n var merged = { info: info, map: map };\n if (needToMergeMaps) {\n var remainingRightKeys_1 = new Set(right.map.keys());\n left.map.forEach(function (leftTree, key) {\n merged.map.set(key, mergeMergeTrees(leftTree, right.map.get(key)));\n remainingRightKeys_1.delete(key);\n });\n remainingRightKeys_1.forEach(function (key) {\n merged.map.set(key, mergeMergeTrees(right.map.get(key), left.map.get(key)));\n });\n }\n return merged;\n}\nfunction mergeTreeIsEmpty(tree) {\n return !tree || !(tree.info || tree.map.size);\n}\nfunction maybeRecycleChildMergeTree(_a, name) {\n var map = _a.map;\n var childTree = map.get(name);\n if (childTree && mergeTreeIsEmpty(childTree)) {\n emptyMergeTreePool.push(childTree);\n map.delete(name);\n }\n}\nvar warnings = new Set();\nfunction warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {\n var getChild = function (objOrRef) {\n var child = store.getFieldValue(objOrRef, storeFieldName);\n return typeof child === \"object\" && child;\n };\n var existing = getChild(existingRef);\n if (!existing)\n return;\n var incoming = getChild(incomingObj);\n if (!incoming)\n return;\n if (isReference(existing))\n return;\n if (equal(existing, incoming))\n return;\n if (Object.keys(existing).every(function (key) { return store.getFieldValue(incoming, key) !== void 0; })) {\n return;\n }\n var parentType = store.getFieldValue(existingRef, \"__typename\") ||\n store.getFieldValue(incomingObj, \"__typename\");\n var fieldName = fieldNameFromStoreName(storeFieldName);\n var typeDotName = \"\".concat(parentType, \".\").concat(fieldName);\n if (warnings.has(typeDotName))\n return;\n warnings.add(typeDotName);\n var childTypenames = [];\n if (!isArray(existing) &&\n !isArray(incoming)) {\n [existing, incoming].forEach(function (child) {\n var typename = store.getFieldValue(child, \"__typename\");\n if (typeof typename === \"string\" &&\n !childTypenames.includes(typename)) {\n childTypenames.push(typename);\n }\n });\n }\n __DEV__ && invariant.warn(\"Cache data may be lost when replacing the \".concat(fieldName, \" field of a \").concat(parentType, \" object.\\n\\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\\n\\nTo address this problem (which is not a bug in Apollo Client), \").concat(childTypenames.length\n ? \"either ensure all objects of type \" +\n childTypenames.join(\" and \") + \" have an ID or a custom merge function, or \"\n : \"\", \"define a custom merge function for the \").concat(typeDotName, \" field, so InMemoryCache can safely merge these objects:\\n\\n existing: \").concat(JSON.stringify(existing).slice(0, 1000), \"\\n incoming: \").concat(JSON.stringify(incoming).slice(0, 1000), \"\\n\\nFor more information about these options, please refer to the documentation:\\n\\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\\n\"));\n}\n//# sourceMappingURL=writeToStore.js.map","import { __assign, __extends } from \"tslib\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport \"./fixPolyfills.js\";\nimport { wrap } from 'optimism';\nimport { equal } from '@wry/equality';\nimport { ApolloCache } from \"../core/cache.js\";\nimport { MissingFieldError } from \"../core/types/common.js\";\nimport { addTypenameToDocument, isReference, } from \"../../utilities/index.js\";\nimport { StoreReader } from \"./readFromStore.js\";\nimport { StoreWriter } from \"./writeToStore.js\";\nimport { EntityStore, supportsResultCaching } from \"./entityStore.js\";\nimport { makeVar, forgetCache, recallCache } from \"./reactiveVars.js\";\nimport { Policies } from \"./policies.js\";\nimport { hasOwn, normalizeConfig, shouldCanonizeResults } from \"./helpers.js\";\nimport { canonicalStringify } from \"./object-canon.js\";\nvar InMemoryCache = (function (_super) {\n __extends(InMemoryCache, _super);\n function InMemoryCache(config) {\n if (config === void 0) { config = {}; }\n var _this = _super.call(this) || this;\n _this.watches = new Set();\n _this.typenameDocumentCache = new Map();\n _this.makeVar = makeVar;\n _this.txCount = 0;\n _this.config = normalizeConfig(config);\n _this.addTypename = !!_this.config.addTypename;\n _this.policies = new Policies({\n cache: _this,\n dataIdFromObject: _this.config.dataIdFromObject,\n possibleTypes: _this.config.possibleTypes,\n typePolicies: _this.config.typePolicies,\n });\n _this.init();\n return _this;\n }\n InMemoryCache.prototype.init = function () {\n var rootStore = this.data = new EntityStore.Root({\n policies: this.policies,\n resultCaching: this.config.resultCaching,\n });\n this.optimisticData = rootStore.stump;\n this.resetResultCache();\n };\n InMemoryCache.prototype.resetResultCache = function (resetResultIdentities) {\n var _this = this;\n var previousReader = this.storeReader;\n var fragments = this.config.fragments;\n this.storeWriter = new StoreWriter(this, this.storeReader = new StoreReader({\n cache: this,\n addTypename: this.addTypename,\n resultCacheMaxSize: this.config.resultCacheMaxSize,\n canonizeResults: shouldCanonizeResults(this.config),\n canon: resetResultIdentities\n ? void 0\n : previousReader && previousReader.canon,\n fragments: fragments,\n }), fragments);\n this.maybeBroadcastWatch = wrap(function (c, options) {\n return _this.broadcastWatch(c, options);\n }, {\n max: this.config.resultCacheMaxSize,\n makeCacheKey: function (c) {\n var store = c.optimistic ? _this.optimisticData : _this.data;\n if (supportsResultCaching(store)) {\n var optimistic = c.optimistic, id = c.id, variables = c.variables;\n return store.makeCacheKey(c.query, c.callback, canonicalStringify({ optimistic: optimistic, id: id, variables: variables }));\n }\n }\n });\n new Set([\n this.data.group,\n this.optimisticData.group,\n ]).forEach(function (group) { return group.resetCaching(); });\n };\n InMemoryCache.prototype.restore = function (data) {\n this.init();\n if (data)\n this.data.replace(data);\n return this;\n };\n InMemoryCache.prototype.extract = function (optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return (optimistic ? this.optimisticData : this.data).extract();\n };\n InMemoryCache.prototype.read = function (options) {\n var _a = options.returnPartialData, returnPartialData = _a === void 0 ? false : _a;\n try {\n return this.storeReader.diffQueryAgainstStore(__assign(__assign({}, options), { store: options.optimistic ? this.optimisticData : this.data, config: this.config, returnPartialData: returnPartialData })).result || null;\n }\n catch (e) {\n if (e instanceof MissingFieldError) {\n return null;\n }\n throw e;\n }\n };\n InMemoryCache.prototype.write = function (options) {\n try {\n ++this.txCount;\n return this.storeWriter.writeToStore(this.data, options);\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.modify = function (options) {\n if (hasOwn.call(options, \"id\") && !options.id) {\n return false;\n }\n var store = options.optimistic\n ? this.optimisticData\n : this.data;\n try {\n ++this.txCount;\n return store.modify(options.id || \"ROOT_QUERY\", options.fields);\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.diff = function (options) {\n return this.storeReader.diffQueryAgainstStore(__assign(__assign({}, options), { store: options.optimistic ? this.optimisticData : this.data, rootId: options.id || \"ROOT_QUERY\", config: this.config }));\n };\n InMemoryCache.prototype.watch = function (watch) {\n var _this = this;\n if (!this.watches.size) {\n recallCache(this);\n }\n this.watches.add(watch);\n if (watch.immediate) {\n this.maybeBroadcastWatch(watch);\n }\n return function () {\n if (_this.watches.delete(watch) && !_this.watches.size) {\n forgetCache(_this);\n }\n _this.maybeBroadcastWatch.forget(watch);\n };\n };\n InMemoryCache.prototype.gc = function (options) {\n canonicalStringify.reset();\n var ids = this.optimisticData.gc();\n if (options && !this.txCount) {\n if (options.resetResultCache) {\n this.resetResultCache(options.resetResultIdentities);\n }\n else if (options.resetResultIdentities) {\n this.storeReader.resetCanon();\n }\n }\n return ids;\n };\n InMemoryCache.prototype.retain = function (rootId, optimistic) {\n return (optimistic ? this.optimisticData : this.data).retain(rootId);\n };\n InMemoryCache.prototype.release = function (rootId, optimistic) {\n return (optimistic ? this.optimisticData : this.data).release(rootId);\n };\n InMemoryCache.prototype.identify = function (object) {\n if (isReference(object))\n return object.__ref;\n try {\n return this.policies.identify(object)[0];\n }\n catch (e) {\n __DEV__ && invariant.warn(e);\n }\n };\n InMemoryCache.prototype.evict = function (options) {\n if (!options.id) {\n if (hasOwn.call(options, \"id\")) {\n return false;\n }\n options = __assign(__assign({}, options), { id: \"ROOT_QUERY\" });\n }\n try {\n ++this.txCount;\n return this.optimisticData.evict(options, this.data);\n }\n finally {\n if (!--this.txCount && options.broadcast !== false) {\n this.broadcastWatches();\n }\n }\n };\n InMemoryCache.prototype.reset = function (options) {\n var _this = this;\n this.init();\n canonicalStringify.reset();\n if (options && options.discardWatches) {\n this.watches.forEach(function (watch) { return _this.maybeBroadcastWatch.forget(watch); });\n this.watches.clear();\n forgetCache(this);\n }\n else {\n this.broadcastWatches();\n }\n return Promise.resolve();\n };\n InMemoryCache.prototype.removeOptimistic = function (idToRemove) {\n var newOptimisticData = this.optimisticData.removeLayer(idToRemove);\n if (newOptimisticData !== this.optimisticData) {\n this.optimisticData = newOptimisticData;\n this.broadcastWatches();\n }\n };\n InMemoryCache.prototype.batch = function (options) {\n var _this = this;\n var update = options.update, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, removeOptimistic = options.removeOptimistic, onWatchUpdated = options.onWatchUpdated;\n var updateResult;\n var perform = function (layer) {\n var _a = _this, data = _a.data, optimisticData = _a.optimisticData;\n ++_this.txCount;\n if (layer) {\n _this.data = _this.optimisticData = layer;\n }\n try {\n return updateResult = update(_this);\n }\n finally {\n --_this.txCount;\n _this.data = data;\n _this.optimisticData = optimisticData;\n }\n };\n var alreadyDirty = new Set();\n if (onWatchUpdated && !this.txCount) {\n this.broadcastWatches(__assign(__assign({}, options), { onWatchUpdated: function (watch) {\n alreadyDirty.add(watch);\n return false;\n } }));\n }\n if (typeof optimistic === 'string') {\n this.optimisticData = this.optimisticData.addLayer(optimistic, perform);\n }\n else if (optimistic === false) {\n perform(this.data);\n }\n else {\n perform();\n }\n if (typeof removeOptimistic === \"string\") {\n this.optimisticData = this.optimisticData.removeLayer(removeOptimistic);\n }\n if (onWatchUpdated && alreadyDirty.size) {\n this.broadcastWatches(__assign(__assign({}, options), { onWatchUpdated: function (watch, diff) {\n var result = onWatchUpdated.call(this, watch, diff);\n if (result !== false) {\n alreadyDirty.delete(watch);\n }\n return result;\n } }));\n if (alreadyDirty.size) {\n alreadyDirty.forEach(function (watch) { return _this.maybeBroadcastWatch.dirty(watch); });\n }\n }\n else {\n this.broadcastWatches(options);\n }\n return updateResult;\n };\n InMemoryCache.prototype.performTransaction = function (update, optimisticId) {\n return this.batch({\n update: update,\n optimistic: optimisticId || (optimisticId !== null),\n });\n };\n InMemoryCache.prototype.transformDocument = function (document) {\n if (this.addTypename) {\n var result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n };\n InMemoryCache.prototype.transformForLink = function (document) {\n var fragments = this.config.fragments;\n return fragments\n ? fragments.transform(document)\n : document;\n };\n InMemoryCache.prototype.broadcastWatches = function (options) {\n var _this = this;\n if (!this.txCount) {\n this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c, options); });\n }\n };\n InMemoryCache.prototype.broadcastWatch = function (c, options) {\n var lastDiff = c.lastDiff;\n var diff = this.diff(c);\n if (options) {\n if (c.optimistic &&\n typeof options.optimistic === \"string\") {\n diff.fromOptimisticTransaction = true;\n }\n if (options.onWatchUpdated &&\n options.onWatchUpdated.call(this, c, diff, lastDiff) === false) {\n return;\n }\n }\n if (!lastDiff || !equal(lastDiff.result, diff.result)) {\n c.callback(c.lastDiff = diff, lastDiff);\n }\n };\n return InMemoryCache;\n}(ApolloCache));\nexport { InMemoryCache };\n//# sourceMappingURL=inMemoryCache.js.map","export var NetworkStatus;\n(function (NetworkStatus) {\n NetworkStatus[NetworkStatus[\"loading\"] = 1] = \"loading\";\n NetworkStatus[NetworkStatus[\"setVariables\"] = 2] = \"setVariables\";\n NetworkStatus[NetworkStatus[\"fetchMore\"] = 3] = \"fetchMore\";\n NetworkStatus[NetworkStatus[\"refetch\"] = 4] = \"refetch\";\n NetworkStatus[NetworkStatus[\"poll\"] = 6] = \"poll\";\n NetworkStatus[NetworkStatus[\"ready\"] = 7] = \"ready\";\n NetworkStatus[NetworkStatus[\"error\"] = 8] = \"error\";\n})(NetworkStatus || (NetworkStatus = {}));\nexport function isNetworkRequestInFlight(networkStatus) {\n return networkStatus ? networkStatus < 7 : false;\n}\n//# sourceMappingURL=networkStatus.js.map","import { __assign, __extends } from \"tslib\";\nimport { invariant } from \"../utilities/globals/index.js\";\nimport { equal } from '@wry/equality';\nimport { NetworkStatus, isNetworkRequestInFlight } from \"./networkStatus.js\";\nimport { cloneDeep, compact, getOperationDefinition, Observable, iterateObserversSafely, isNonEmptyArray, fixObservableSubclass, getQueryDefinition, } from \"../utilities/index.js\";\nvar assign = Object.assign, hasOwnProperty = Object.hasOwnProperty;\nvar ObservableQuery = (function (_super) {\n __extends(ObservableQuery, _super);\n function ObservableQuery(_a) {\n var queryManager = _a.queryManager, queryInfo = _a.queryInfo, options = _a.options;\n var _this = _super.call(this, function (observer) {\n try {\n var subObserver = observer._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n }\n catch (_a) { }\n var first = !_this.observers.size;\n _this.observers.add(observer);\n var last = _this.last;\n if (last && last.error) {\n observer.error && observer.error(last.error);\n }\n else if (last && last.result) {\n observer.next && observer.next(last.result);\n }\n if (first) {\n _this.reobserve().catch(function () { });\n }\n return function () {\n if (_this.observers.delete(observer) && !_this.observers.size) {\n _this.tearDownQuery();\n }\n };\n }) || this;\n _this.observers = new Set();\n _this.subscriptions = new Set();\n _this.queryInfo = queryInfo;\n _this.queryManager = queryManager;\n _this.waitForOwnResult = skipCacheDataFor(options.fetchPolicy);\n _this.isTornDown = false;\n var _b = queryManager.defaultOptions.watchQuery, _c = _b === void 0 ? {} : _b, _d = _c.fetchPolicy, defaultFetchPolicy = _d === void 0 ? \"cache-first\" : _d;\n var _e = options.fetchPolicy, fetchPolicy = _e === void 0 ? defaultFetchPolicy : _e, _f = options.initialFetchPolicy, initialFetchPolicy = _f === void 0 ? (fetchPolicy === \"standby\" ? defaultFetchPolicy : fetchPolicy) : _f;\n _this.options = __assign(__assign({}, options), { initialFetchPolicy: initialFetchPolicy, fetchPolicy: fetchPolicy });\n _this.queryId = queryInfo.queryId || queryManager.generateQueryId();\n var opDef = getOperationDefinition(_this.query);\n _this.queryName = opDef && opDef.name && opDef.name.value;\n return _this;\n }\n Object.defineProperty(ObservableQuery.prototype, \"query\", {\n get: function () {\n return this.queryManager.transform(this.options.query).document;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ObservableQuery.prototype, \"variables\", {\n get: function () {\n return this.options.variables;\n },\n enumerable: false,\n configurable: true\n });\n ObservableQuery.prototype.result = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var observer = {\n next: function (result) {\n resolve(result);\n _this.observers.delete(observer);\n if (!_this.observers.size) {\n _this.queryManager.removeQuery(_this.queryId);\n }\n setTimeout(function () {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n var subscription = _this.subscribe(observer);\n });\n };\n ObservableQuery.prototype.getCurrentResult = function (saveAsLastResult) {\n if (saveAsLastResult === void 0) { saveAsLastResult = true; }\n var lastResult = this.getLastResult(true);\n var networkStatus = this.queryInfo.networkStatus ||\n (lastResult && lastResult.networkStatus) ||\n NetworkStatus.ready;\n var result = __assign(__assign({}, lastResult), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });\n var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? \"cache-first\" : _a;\n if (skipCacheDataFor(fetchPolicy) ||\n this.queryManager.transform(this.options.query).hasForcedResolvers) {\n }\n else if (this.waitForOwnResult) {\n this.queryInfo['updateWatch']();\n }\n else {\n var diff = this.queryInfo.getDiff();\n if (diff.complete || this.options.returnPartialData) {\n result.data = diff.result;\n }\n if (equal(result.data, {})) {\n result.data = void 0;\n }\n if (diff.complete) {\n delete result.partial;\n if (diff.complete &&\n result.networkStatus === NetworkStatus.loading &&\n (fetchPolicy === 'cache-first' ||\n fetchPolicy === 'cache-only')) {\n result.networkStatus = NetworkStatus.ready;\n result.loading = false;\n }\n }\n else {\n result.partial = true;\n }\n if (__DEV__ &&\n !diff.complete &&\n !this.options.partialRefetch &&\n !result.loading &&\n !result.data &&\n !result.error) {\n logMissingFieldErrors(diff.missing);\n }\n }\n if (saveAsLastResult) {\n this.updateLastResult(result);\n }\n return result;\n };\n ObservableQuery.prototype.isDifferentFromLastResult = function (newResult, variables) {\n return (!this.last ||\n !equal(this.last.result, newResult) ||\n (variables && !equal(this.last.variables, variables)));\n };\n ObservableQuery.prototype.getLast = function (key, variablesMustMatch) {\n var last = this.last;\n if (last &&\n last[key] &&\n (!variablesMustMatch || equal(last.variables, this.variables))) {\n return last[key];\n }\n };\n ObservableQuery.prototype.getLastResult = function (variablesMustMatch) {\n return this.getLast(\"result\", variablesMustMatch);\n };\n ObservableQuery.prototype.getLastError = function (variablesMustMatch) {\n return this.getLast(\"error\", variablesMustMatch);\n };\n ObservableQuery.prototype.resetLastResults = function () {\n delete this.last;\n this.isTornDown = false;\n };\n ObservableQuery.prototype.resetQueryStoreErrors = function () {\n this.queryManager.resetErrors(this.queryId);\n };\n ObservableQuery.prototype.refetch = function (variables) {\n var _a;\n var reobserveOptions = {\n pollInterval: 0,\n };\n var fetchPolicy = this.options.fetchPolicy;\n if (fetchPolicy === 'cache-and-network') {\n reobserveOptions.fetchPolicy = fetchPolicy;\n }\n else if (fetchPolicy === 'no-cache') {\n reobserveOptions.fetchPolicy = 'no-cache';\n }\n else {\n reobserveOptions.fetchPolicy = 'network-only';\n }\n if (__DEV__ && variables && hasOwnProperty.call(variables, \"variables\")) {\n var queryDef = getQueryDefinition(this.query);\n var vars = queryDef.variableDefinitions;\n if (!vars || !vars.some(function (v) { return v.variable.name.value === \"variables\"; })) {\n __DEV__ && invariant.warn(\"Called refetch(\".concat(JSON.stringify(variables), \") for query \").concat(((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || JSON.stringify(queryDef), \", which does not declare a $variables variable.\\nDid you mean to call refetch(variables) instead of refetch({ variables })?\"));\n }\n }\n if (variables && !equal(this.options.variables, variables)) {\n reobserveOptions.variables = this.options.variables = __assign(__assign({}, this.options.variables), variables);\n }\n this.queryInfo.resetLastWrite();\n return this.reobserve(reobserveOptions, NetworkStatus.refetch);\n };\n ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {\n var _this = this;\n var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign(__assign(__assign(__assign({}, this.options), { query: this.query }), fetchMoreOptions), { variables: __assign(__assign({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: \"no-cache\" });\n var qid = this.queryManager.generateQueryId();\n var queryInfo = this.queryInfo;\n var originalNetworkStatus = queryInfo.networkStatus;\n queryInfo.networkStatus = NetworkStatus.fetchMore;\n if (combinedOptions.notifyOnNetworkStatusChange) {\n this.observe();\n }\n var updatedQuerySet = new Set();\n return this.queryManager.fetchQuery(qid, combinedOptions, NetworkStatus.fetchMore).then(function (fetchMoreResult) {\n _this.queryManager.removeQuery(qid);\n if (queryInfo.networkStatus === NetworkStatus.fetchMore) {\n queryInfo.networkStatus = originalNetworkStatus;\n }\n _this.queryManager.cache.batch({\n update: function (cache) {\n var updateQuery = fetchMoreOptions.updateQuery;\n if (updateQuery) {\n cache.updateQuery({\n query: _this.query,\n variables: _this.variables,\n returnPartialData: true,\n optimistic: false,\n }, function (previous) { return updateQuery(previous, {\n fetchMoreResult: fetchMoreResult.data,\n variables: combinedOptions.variables,\n }); });\n }\n else {\n cache.writeQuery({\n query: combinedOptions.query,\n variables: combinedOptions.variables,\n data: fetchMoreResult.data,\n });\n }\n },\n onWatchUpdated: function (watch) {\n updatedQuerySet.add(watch.query);\n },\n });\n return fetchMoreResult;\n }).finally(function () {\n if (!updatedQuerySet.has(_this.query)) {\n reobserveCacheFirst(_this);\n }\n });\n };\n ObservableQuery.prototype.subscribeToMore = function (options) {\n var _this = this;\n var subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n context: options.context,\n })\n .subscribe({\n next: function (subscriptionData) {\n var updateQuery = options.updateQuery;\n if (updateQuery) {\n _this.updateQuery(function (previous, _a) {\n var variables = _a.variables;\n return updateQuery(previous, {\n subscriptionData: subscriptionData,\n variables: variables,\n });\n });\n }\n },\n error: function (err) {\n if (options.onError) {\n options.onError(err);\n return;\n }\n __DEV__ && invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n this.subscriptions.add(subscription);\n return function () {\n if (_this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n };\n ObservableQuery.prototype.setOptions = function (newOptions) {\n return this.reobserve(newOptions);\n };\n ObservableQuery.prototype.setVariables = function (variables) {\n if (equal(this.variables, variables)) {\n return this.observers.size\n ? this.result()\n : Promise.resolve();\n }\n this.options.variables = variables;\n if (!this.observers.size) {\n return Promise.resolve();\n }\n return this.reobserve({\n fetchPolicy: this.options.initialFetchPolicy,\n variables: variables,\n }, NetworkStatus.setVariables);\n };\n ObservableQuery.prototype.updateQuery = function (mapFn) {\n var queryManager = this.queryManager;\n var result = queryManager.cache.diff({\n query: this.options.query,\n variables: this.variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n var newResult = mapFn(result, {\n variables: this.variables,\n });\n if (newResult) {\n queryManager.cache.writeQuery({\n query: this.options.query,\n data: newResult,\n variables: this.variables,\n });\n queryManager.broadcastQueries();\n }\n };\n ObservableQuery.prototype.startPolling = function (pollInterval) {\n this.options.pollInterval = pollInterval;\n this.updatePolling();\n };\n ObservableQuery.prototype.stopPolling = function () {\n this.options.pollInterval = 0;\n this.updatePolling();\n };\n ObservableQuery.prototype.applyNextFetchPolicy = function (reason, options) {\n if (options.nextFetchPolicy) {\n var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? \"cache-first\" : _a, _b = options.initialFetchPolicy, initialFetchPolicy = _b === void 0 ? fetchPolicy : _b;\n if (fetchPolicy === \"standby\") {\n }\n else if (typeof options.nextFetchPolicy === \"function\") {\n options.fetchPolicy = options.nextFetchPolicy(fetchPolicy, {\n reason: reason,\n options: options,\n observable: this,\n initialFetchPolicy: initialFetchPolicy,\n });\n }\n else if (reason === \"variables-changed\") {\n options.fetchPolicy = initialFetchPolicy;\n }\n else {\n options.fetchPolicy = options.nextFetchPolicy;\n }\n }\n return options.fetchPolicy;\n };\n ObservableQuery.prototype.fetch = function (options, newNetworkStatus) {\n this.queryManager.setObservableQuery(this);\n return this.queryManager['fetchConcastWithInfo'](this.queryId, options, newNetworkStatus);\n };\n ObservableQuery.prototype.updatePolling = function () {\n var _this = this;\n if (this.queryManager.ssrMode) {\n return;\n }\n var _a = this, pollingInfo = _a.pollingInfo, pollInterval = _a.options.pollInterval;\n if (!pollInterval) {\n if (pollingInfo) {\n clearTimeout(pollingInfo.timeout);\n delete this.pollingInfo;\n }\n return;\n }\n if (pollingInfo &&\n pollingInfo.interval === pollInterval) {\n return;\n }\n __DEV__ ? invariant(pollInterval, 'Attempted to start a polling query without a polling interval.') : invariant(pollInterval, 13);\n var info = pollingInfo || (this.pollingInfo = {});\n info.interval = pollInterval;\n var maybeFetch = function () {\n if (_this.pollingInfo) {\n if (!isNetworkRequestInFlight(_this.queryInfo.networkStatus)) {\n _this.reobserve({\n fetchPolicy: _this.options.initialFetchPolicy === 'no-cache' ? 'no-cache' : 'network-only',\n }, NetworkStatus.poll).then(poll, poll);\n }\n else {\n poll();\n }\n }\n ;\n };\n var poll = function () {\n var info = _this.pollingInfo;\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n poll();\n };\n ObservableQuery.prototype.updateLastResult = function (newResult, variables) {\n if (variables === void 0) { variables = this.variables; }\n this.last = __assign(__assign({}, this.last), { result: this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult), variables: variables });\n if (!isNonEmptyArray(newResult.errors)) {\n delete this.last.error;\n }\n return this.last;\n };\n ObservableQuery.prototype.reobserveAsConcast = function (newOptions, newNetworkStatus) {\n var _this = this;\n this.isTornDown = false;\n var useDisposableConcast = newNetworkStatus === NetworkStatus.refetch ||\n newNetworkStatus === NetworkStatus.fetchMore ||\n newNetworkStatus === NetworkStatus.poll;\n var oldVariables = this.options.variables;\n var oldFetchPolicy = this.options.fetchPolicy;\n var mergedOptions = compact(this.options, newOptions || {});\n var options = useDisposableConcast\n ? mergedOptions\n : assign(this.options, mergedOptions);\n if (!useDisposableConcast) {\n this.updatePolling();\n if (newOptions &&\n newOptions.variables &&\n !equal(newOptions.variables, oldVariables) &&\n options.fetchPolicy !== \"standby\" &&\n options.fetchPolicy === oldFetchPolicy) {\n this.applyNextFetchPolicy(\"variables-changed\", options);\n if (newNetworkStatus === void 0) {\n newNetworkStatus = NetworkStatus.setVariables;\n }\n }\n }\n this.waitForOwnResult && (this.waitForOwnResult = skipCacheDataFor(options.fetchPolicy));\n var finishWaitingForOwnResult = function () {\n if (_this.concast === concast) {\n _this.waitForOwnResult = false;\n }\n };\n var variables = options.variables && __assign({}, options.variables);\n var _a = this.fetch(options, newNetworkStatus), concast = _a.concast, fromLink = _a.fromLink;\n var observer = {\n next: function (result) {\n finishWaitingForOwnResult();\n _this.reportResult(result, variables);\n },\n error: function (error) {\n finishWaitingForOwnResult();\n _this.reportError(error, variables);\n },\n };\n if (!useDisposableConcast && fromLink) {\n if (this.concast && this.observer) {\n this.concast.removeObserver(this.observer);\n }\n this.concast = concast;\n this.observer = observer;\n }\n concast.addObserver(observer);\n return concast;\n };\n ObservableQuery.prototype.reobserve = function (newOptions, newNetworkStatus) {\n return this.reobserveAsConcast(newOptions, newNetworkStatus).promise;\n };\n ObservableQuery.prototype.observe = function () {\n this.reportResult(this.getCurrentResult(false), this.variables);\n };\n ObservableQuery.prototype.reportResult = function (result, variables) {\n var lastError = this.getLastError();\n if (lastError || this.isDifferentFromLastResult(result, variables)) {\n if (lastError || !result.partial || this.options.returnPartialData) {\n this.updateLastResult(result, variables);\n }\n iterateObserversSafely(this.observers, 'next', result);\n }\n };\n ObservableQuery.prototype.reportError = function (error, variables) {\n var errorResult = __assign(__assign({}, this.getLastResult()), { error: error, errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false });\n this.updateLastResult(errorResult, variables);\n iterateObserversSafely(this.observers, 'error', this.last.error = error);\n };\n ObservableQuery.prototype.hasObservers = function () {\n return this.observers.size > 0;\n };\n ObservableQuery.prototype.tearDownQuery = function () {\n if (this.isTornDown)\n return;\n if (this.concast && this.observer) {\n this.concast.removeObserver(this.observer);\n delete this.concast;\n delete this.observer;\n }\n this.stopPolling();\n this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });\n this.subscriptions.clear();\n this.queryManager.stopQuery(this.queryId);\n this.observers.clear();\n this.isTornDown = true;\n };\n return ObservableQuery;\n}(Observable));\nexport { ObservableQuery };\nfixObservableSubclass(ObservableQuery);\nexport function reobserveCacheFirst(obsQuery) {\n var _a = obsQuery.options, fetchPolicy = _a.fetchPolicy, nextFetchPolicy = _a.nextFetchPolicy;\n if (fetchPolicy === \"cache-and-network\" ||\n fetchPolicy === \"network-only\") {\n return obsQuery.reobserve({\n fetchPolicy: \"cache-first\",\n nextFetchPolicy: function () {\n this.nextFetchPolicy = nextFetchPolicy;\n if (typeof nextFetchPolicy === \"function\") {\n return nextFetchPolicy.apply(this, arguments);\n }\n return fetchPolicy;\n },\n });\n }\n return obsQuery.reobserve();\n}\nfunction defaultSubscriptionObserverErrorCallback(error) {\n __DEV__ && invariant.error('Unhandled error', error.message, error.stack);\n}\nexport function logMissingFieldErrors(missing) {\n if (__DEV__ && missing) {\n __DEV__ && invariant.debug(\"Missing cache result fields: \".concat(JSON.stringify(missing)), missing);\n }\n}\nfunction skipCacheDataFor(fetchPolicy) {\n return fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\" || fetchPolicy === \"standby\";\n}\n//# sourceMappingURL=ObservableQuery.js.map","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { invariant } from \"../utilities/globals/index.js\";\nimport { visit, BREAK, isSelectionNode, } from 'graphql';\nimport { argumentsObjectFromField, buildQueryFromSelectionSet, createFragmentMap, getFragmentDefinitions, getMainDefinition, hasDirectives, isField, isInlineFragment, mergeDeep, mergeDeepArray, removeClientSetsFromDocument, resultKeyNameFromField, shouldInclude, } from \"../utilities/index.js\";\nimport { cacheSlot } from \"../cache/index.js\";\nvar LocalState = (function () {\n function LocalState(_a) {\n var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher;\n this.selectionsToResolveCache = new WeakMap();\n this.cache = cache;\n if (client) {\n this.client = client;\n }\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n LocalState.prototype.addResolvers = function (resolvers) {\n var _this = this;\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(function (resolverGroup) {\n _this.resolvers = mergeDeep(_this.resolvers, resolverGroup);\n });\n }\n else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n };\n LocalState.prototype.setResolvers = function (resolvers) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n };\n LocalState.prototype.getResolvers = function () {\n return this.resolvers || {};\n };\n LocalState.prototype.runResolvers = function (_a) {\n var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b;\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_c) {\n if (document) {\n return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign(__assign({}, remoteResult), { data: localResult.result })); })];\n }\n return [2, remoteResult];\n });\n });\n };\n LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n };\n LocalState.prototype.getFragmentMatcher = function () {\n return this.fragmentMatcher;\n };\n LocalState.prototype.clientQuery = function (document) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n }\n return null;\n };\n LocalState.prototype.serverQuery = function (document) {\n return removeClientSetsFromDocument(document);\n };\n LocalState.prototype.prepareContext = function (context) {\n var cache = this.cache;\n return __assign(__assign({}, context), { cache: cache, getCacheKey: function (obj) {\n return cache.identify(obj);\n } });\n };\n LocalState.prototype.addExportedVariables = function (document, variables, context) {\n if (variables === void 0) { variables = {}; }\n if (context === void 0) { context = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (document) {\n return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign(__assign({}, variables), data.exportedVariables)); })];\n }\n return [2, __assign({}, variables)];\n });\n });\n };\n LocalState.prototype.shouldForceResolvers = function (document) {\n var forceResolvers = false;\n visit(document, {\n Directive: {\n enter: function (node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(function (arg) {\n return arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true;\n });\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n };\n LocalState.prototype.buildRootValueFromCache = function (document, variables) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables: variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n };\n LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) {\n if (context === void 0) { context = {}; }\n if (variables === void 0) { variables = {}; }\n if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; }\n if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; }\n return __awaiter(this, void 0, void 0, function () {\n var mainDefinition, fragments, fragmentMap, selectionsToResolve, definitionOperation, defaultOperationType, _a, cache, client, execContext, isClientFieldDescendant;\n return __generator(this, function (_b) {\n mainDefinition = getMainDefinition(document);\n fragments = getFragmentDefinitions(document);\n fragmentMap = createFragmentMap(fragments);\n selectionsToResolve = this.collectSelectionsToResolve(mainDefinition, fragmentMap);\n definitionOperation = mainDefinition.operation;\n defaultOperationType = definitionOperation\n ? definitionOperation.charAt(0).toUpperCase() +\n definitionOperation.slice(1)\n : 'Query';\n _a = this, cache = _a.cache, client = _a.client;\n execContext = {\n fragmentMap: fragmentMap,\n context: __assign(__assign({}, context), { cache: cache, client: client }),\n variables: variables,\n fragmentMatcher: fragmentMatcher,\n defaultOperationType: defaultOperationType,\n exportedVariables: {},\n selectionsToResolve: selectionsToResolve,\n onlyRunForcedResolvers: onlyRunForcedResolvers,\n };\n isClientFieldDescendant = false;\n return [2, this.resolveSelectionSet(mainDefinition.selectionSet, isClientFieldDescendant, rootValue, execContext).then(function (result) { return ({\n result: result,\n exportedVariables: execContext.exportedVariables,\n }); })];\n });\n });\n };\n LocalState.prototype.resolveSelectionSet = function (selectionSet, isClientFieldDescendant, rootValue, execContext) {\n return __awaiter(this, void 0, void 0, function () {\n var fragmentMap, context, variables, resultsToMerge, execute;\n var _this = this;\n return __generator(this, function (_a) {\n fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables;\n resultsToMerge = [rootValue];\n execute = function (selection) { return __awaiter(_this, void 0, void 0, function () {\n var fragment, typeCondition;\n return __generator(this, function (_a) {\n if (!isClientFieldDescendant && !execContext.selectionsToResolve.has(selection)) {\n return [2];\n }\n if (!shouldInclude(selection, variables)) {\n return [2];\n }\n if (isField(selection)) {\n return [2, this.resolveField(selection, isClientFieldDescendant, rootValue, execContext).then(function (fieldResult) {\n var _a;\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push((_a = {},\n _a[resultKeyNameFromField(selection)] = fieldResult,\n _a));\n }\n })];\n }\n if (isInlineFragment(selection)) {\n fragment = selection;\n }\n else {\n fragment = fragmentMap[selection.name.value];\n __DEV__ ? invariant(fragment, \"No fragment named \".concat(selection.name.value)) : invariant(fragment, 11);\n }\n if (fragment && fragment.typeCondition) {\n typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return [2, this.resolveSelectionSet(fragment.selectionSet, isClientFieldDescendant, rootValue, execContext).then(function (fragmentResult) {\n resultsToMerge.push(fragmentResult);\n })];\n }\n }\n return [2];\n });\n }); };\n return [2, Promise.all(selectionSet.selections.map(execute)).then(function () {\n return mergeDeepArray(resultsToMerge);\n })];\n });\n });\n };\n LocalState.prototype.resolveField = function (field, isClientFieldDescendant, rootValue, execContext) {\n return __awaiter(this, void 0, void 0, function () {\n var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve;\n var _this = this;\n return __generator(this, function (_a) {\n if (!rootValue) {\n return [2, null];\n }\n variables = execContext.variables;\n fieldName = field.name.value;\n aliasedFieldName = resultKeyNameFromField(field);\n aliasUsed = fieldName !== aliasedFieldName;\n defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n resultPromise = Promise.resolve(defaultResult);\n if (!execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)) {\n resolverType = rootValue.__typename || execContext.defaultOperationType;\n resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(cacheSlot.withValue(this.cache, resolve, [\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field: field, fragmentMap: execContext.fragmentMap },\n ]));\n }\n }\n }\n return [2, resultPromise.then(function (result) {\n var _a, _b;\n if (result === void 0) { result = defaultResult; }\n if (field.directives) {\n field.directives.forEach(function (directive) {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(function (arg) {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n if (!field.selectionSet) {\n return result;\n }\n if (result == null) {\n return result;\n }\n var isClientField = (_b = (_a = field.directives) === null || _a === void 0 ? void 0 : _a.some(function (d) { return d.name.value === 'client'; })) !== null && _b !== void 0 ? _b : false;\n if (Array.isArray(result)) {\n return _this.resolveSubSelectedArray(field, isClientFieldDescendant || isClientField, result, execContext);\n }\n if (field.selectionSet) {\n return _this.resolveSelectionSet(field.selectionSet, isClientFieldDescendant || isClientField, result, execContext);\n }\n })];\n });\n });\n };\n LocalState.prototype.resolveSubSelectedArray = function (field, isClientFieldDescendant, result, execContext) {\n var _this = this;\n return Promise.all(result.map(function (item) {\n if (item === null) {\n return null;\n }\n if (Array.isArray(item)) {\n return _this.resolveSubSelectedArray(field, isClientFieldDescendant, item, execContext);\n }\n if (field.selectionSet) {\n return _this.resolveSelectionSet(field.selectionSet, isClientFieldDescendant, item, execContext);\n }\n }));\n };\n LocalState.prototype.collectSelectionsToResolve = function (mainDefinition, fragmentMap) {\n var isSingleASTNode = function (node) { return !Array.isArray(node); };\n var selectionsToResolveCache = this.selectionsToResolveCache;\n function collectByDefinition(definitionNode) {\n if (!selectionsToResolveCache.has(definitionNode)) {\n var matches_1 = new Set();\n selectionsToResolveCache.set(definitionNode, matches_1);\n visit(definitionNode, {\n Directive: function (node, _, __, ___, ancestors) {\n if (node.name.value === 'client') {\n ancestors.forEach(function (node) {\n if (isSingleASTNode(node) && isSelectionNode(node)) {\n matches_1.add(node);\n }\n });\n }\n },\n FragmentSpread: function (spread, _, __, ___, ancestors) {\n var fragment = fragmentMap[spread.name.value];\n __DEV__ ? invariant(fragment, \"No fragment named \".concat(spread.name.value)) : invariant(fragment, 12);\n var fragmentSelections = collectByDefinition(fragment);\n if (fragmentSelections.size > 0) {\n ancestors.forEach(function (node) {\n if (isSingleASTNode(node) && isSelectionNode(node)) {\n matches_1.add(node);\n }\n });\n matches_1.add(spread);\n fragmentSelections.forEach(function (selection) {\n matches_1.add(selection);\n });\n }\n }\n });\n }\n return selectionsToResolveCache.get(definitionNode);\n }\n return collectByDefinition(mainDefinition);\n };\n return LocalState;\n}());\nexport { LocalState };\n//# sourceMappingURL=LocalState.js.map","import { __assign } from \"tslib\";\nimport { equal } from \"@wry/equality\";\nimport { DeepMerger } from \"../utilities/index.js\";\nimport { mergeIncrementalData } from \"../utilities/common/incrementalResult.js\";\nimport { reobserveCacheFirst } from \"./ObservableQuery.js\";\nimport { isNonEmptyArray, graphQLResultHasError, canUseWeakMap, } from \"../utilities/index.js\";\nimport { NetworkStatus, isNetworkRequestInFlight, } from \"./networkStatus.js\";\n;\nvar destructiveMethodCounts = new (canUseWeakMap ? WeakMap : Map)();\nfunction wrapDestructiveCacheMethod(cache, methodName) {\n var original = cache[methodName];\n if (typeof original === \"function\") {\n cache[methodName] = function () {\n destructiveMethodCounts.set(cache, (destructiveMethodCounts.get(cache) + 1) % 1e15);\n return original.apply(this, arguments);\n };\n }\n}\nfunction cancelNotifyTimeout(info) {\n if (info[\"notifyTimeout\"]) {\n clearTimeout(info[\"notifyTimeout\"]);\n info[\"notifyTimeout\"] = void 0;\n }\n}\nvar QueryInfo = (function () {\n function QueryInfo(queryManager, queryId) {\n if (queryId === void 0) { queryId = queryManager.generateQueryId(); }\n this.queryId = queryId;\n this.listeners = new Set();\n this.document = null;\n this.lastRequestId = 1;\n this.subscriptions = new Set();\n this.stopped = false;\n this.dirty = false;\n this.observableQuery = null;\n var cache = this.cache = queryManager.cache;\n if (!destructiveMethodCounts.has(cache)) {\n destructiveMethodCounts.set(cache, 0);\n wrapDestructiveCacheMethod(cache, \"evict\");\n wrapDestructiveCacheMethod(cache, \"modify\");\n wrapDestructiveCacheMethod(cache, \"reset\");\n }\n }\n QueryInfo.prototype.init = function (query) {\n var networkStatus = query.networkStatus || NetworkStatus.loading;\n if (this.variables &&\n this.networkStatus !== NetworkStatus.loading &&\n !equal(this.variables, query.variables)) {\n networkStatus = NetworkStatus.setVariables;\n }\n if (!equal(query.variables, this.variables)) {\n this.lastDiff = void 0;\n }\n Object.assign(this, {\n document: query.document,\n variables: query.variables,\n networkError: null,\n graphQLErrors: this.graphQLErrors || [],\n networkStatus: networkStatus,\n });\n if (query.observableQuery) {\n this.setObservableQuery(query.observableQuery);\n }\n if (query.lastRequestId) {\n this.lastRequestId = query.lastRequestId;\n }\n return this;\n };\n QueryInfo.prototype.reset = function () {\n cancelNotifyTimeout(this);\n this.dirty = false;\n };\n QueryInfo.prototype.getDiff = function (variables) {\n if (variables === void 0) { variables = this.variables; }\n var options = this.getDiffOptions(variables);\n if (this.lastDiff && equal(options, this.lastDiff.options)) {\n return this.lastDiff.diff;\n }\n this.updateWatch(this.variables = variables);\n var oq = this.observableQuery;\n if (oq && oq.options.fetchPolicy === \"no-cache\") {\n return { complete: false };\n }\n var diff = this.cache.diff(options);\n this.updateLastDiff(diff, options);\n return diff;\n };\n QueryInfo.prototype.updateLastDiff = function (diff, options) {\n this.lastDiff = diff ? {\n diff: diff,\n options: options || this.getDiffOptions(),\n } : void 0;\n };\n QueryInfo.prototype.getDiffOptions = function (variables) {\n var _a;\n if (variables === void 0) { variables = this.variables; }\n return {\n query: this.document,\n variables: variables,\n returnPartialData: true,\n optimistic: true,\n canonizeResults: (_a = this.observableQuery) === null || _a === void 0 ? void 0 : _a.options.canonizeResults,\n };\n };\n QueryInfo.prototype.setDiff = function (diff) {\n var _this = this;\n var oldDiff = this.lastDiff && this.lastDiff.diff;\n this.updateLastDiff(diff);\n if (!this.dirty &&\n !equal(oldDiff && oldDiff.result, diff && diff.result)) {\n this.dirty = true;\n if (!this.notifyTimeout) {\n this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0);\n }\n }\n };\n QueryInfo.prototype.setObservableQuery = function (oq) {\n var _this = this;\n if (oq === this.observableQuery)\n return;\n if (this.oqListener) {\n this.listeners.delete(this.oqListener);\n }\n this.observableQuery = oq;\n if (oq) {\n oq[\"queryInfo\"] = this;\n this.listeners.add(this.oqListener = function () {\n var diff = _this.getDiff();\n if (diff.fromOptimisticTransaction) {\n oq[\"observe\"]();\n }\n else {\n reobserveCacheFirst(oq);\n }\n });\n }\n else {\n delete this.oqListener;\n }\n };\n QueryInfo.prototype.notify = function () {\n var _this = this;\n cancelNotifyTimeout(this);\n if (this.shouldNotify()) {\n this.listeners.forEach(function (listener) { return listener(_this); });\n }\n this.dirty = false;\n };\n QueryInfo.prototype.shouldNotify = function () {\n if (!this.dirty || !this.listeners.size) {\n return false;\n }\n if (isNetworkRequestInFlight(this.networkStatus) &&\n this.observableQuery) {\n var fetchPolicy = this.observableQuery.options.fetchPolicy;\n if (fetchPolicy !== \"cache-only\" &&\n fetchPolicy !== \"cache-and-network\") {\n return false;\n }\n }\n return true;\n };\n QueryInfo.prototype.stop = function () {\n if (!this.stopped) {\n this.stopped = true;\n this.reset();\n this.cancel();\n this.cancel = QueryInfo.prototype.cancel;\n this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });\n var oq = this.observableQuery;\n if (oq)\n oq.stopPolling();\n }\n };\n QueryInfo.prototype.cancel = function () { };\n QueryInfo.prototype.updateWatch = function (variables) {\n var _this = this;\n if (variables === void 0) { variables = this.variables; }\n var oq = this.observableQuery;\n if (oq && oq.options.fetchPolicy === \"no-cache\") {\n return;\n }\n var watchOptions = __assign(__assign({}, this.getDiffOptions(variables)), { watcher: this, callback: function (diff) { return _this.setDiff(diff); } });\n if (!this.lastWatch ||\n !equal(watchOptions, this.lastWatch)) {\n this.cancel();\n this.cancel = this.cache.watch(this.lastWatch = watchOptions);\n }\n };\n QueryInfo.prototype.resetLastWrite = function () {\n this.lastWrite = void 0;\n };\n QueryInfo.prototype.shouldWrite = function (result, variables) {\n var lastWrite = this.lastWrite;\n return !(lastWrite &&\n lastWrite.dmCount === destructiveMethodCounts.get(this.cache) &&\n equal(variables, lastWrite.variables) &&\n equal(result.data, lastWrite.result.data));\n };\n QueryInfo.prototype.markResult = function (result, document, options, cacheWriteBehavior) {\n var _this = this;\n var merger = new DeepMerger();\n var graphQLErrors = isNonEmptyArray(result.errors)\n ? result.errors.slice(0)\n : [];\n this.reset();\n if ('incremental' in result && isNonEmptyArray(result.incremental)) {\n var mergedData = mergeIncrementalData(this.getDiff().result, result);\n result.data = mergedData;\n }\n else if ('hasNext' in result && result.hasNext) {\n var diff = this.getDiff();\n result.data = merger.merge(diff.result, result.data);\n }\n this.graphQLErrors = graphQLErrors;\n if (options.fetchPolicy === 'no-cache') {\n this.updateLastDiff({ result: result.data, complete: true }, this.getDiffOptions(options.variables));\n }\n else if (cacheWriteBehavior !== 0) {\n if (shouldWriteResult(result, options.errorPolicy)) {\n this.cache.performTransaction(function (cache) {\n if (_this.shouldWrite(result, options.variables)) {\n cache.writeQuery({\n query: document,\n data: result.data,\n variables: options.variables,\n overwrite: cacheWriteBehavior === 1,\n });\n _this.lastWrite = {\n result: result,\n variables: options.variables,\n dmCount: destructiveMethodCounts.get(_this.cache),\n };\n }\n else {\n if (_this.lastDiff &&\n _this.lastDiff.diff.complete) {\n result.data = _this.lastDiff.diff.result;\n return;\n }\n }\n var diffOptions = _this.getDiffOptions(options.variables);\n var diff = cache.diff(diffOptions);\n if (!_this.stopped) {\n _this.updateWatch(options.variables);\n }\n _this.updateLastDiff(diff, diffOptions);\n if (diff.complete) {\n result.data = diff.result;\n }\n });\n }\n else {\n this.lastWrite = void 0;\n }\n }\n };\n QueryInfo.prototype.markReady = function () {\n this.networkError = null;\n return this.networkStatus = NetworkStatus.ready;\n };\n QueryInfo.prototype.markError = function (error) {\n this.networkStatus = NetworkStatus.error;\n this.lastWrite = void 0;\n this.reset();\n if (error.graphQLErrors) {\n this.graphQLErrors = error.graphQLErrors;\n }\n if (error.networkError) {\n this.networkError = error.networkError;\n }\n return error;\n };\n return QueryInfo;\n}());\nexport { QueryInfo };\nexport function shouldWriteResult(result, errorPolicy) {\n if (errorPolicy === void 0) { errorPolicy = \"none\"; }\n var ignoreErrors = errorPolicy === \"ignore\" ||\n errorPolicy === \"all\";\n var writeWithErrors = !graphQLResultHasError(result);\n if (!writeWithErrors && ignoreErrors && result.data) {\n writeWithErrors = true;\n }\n return writeWithErrors;\n}\n//# sourceMappingURL=QueryInfo.js.map","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { invariant, InvariantError } from \"../utilities/globals/index.js\";\nimport { equal } from '@wry/equality';\nimport { execute } from \"../link/core/index.js\";\nimport { isExecutionPatchIncrementalResult, isExecutionPatchResult, } from \"../utilities/common/incrementalResult.js\";\nimport { canonicalStringify } from \"../cache/index.js\";\nimport { getDefaultValues, getOperationDefinition, getOperationName, hasClientExports, graphQLResultHasError, getGraphQLErrorsFromResult, removeConnectionDirectiveFromDocument, canUseWeakMap, Observable, asyncMap, isNonEmptyArray, Concast, makeUniqueId, isDocumentNode, isNonNullObject, } from \"../utilities/index.js\";\nimport { mergeIncrementalData } from \"../utilities/common/incrementalResult.js\";\nimport { ApolloError, isApolloError, graphQLResultHasProtocolErrors } from \"../errors/index.js\";\nimport { ObservableQuery, logMissingFieldErrors } from \"./ObservableQuery.js\";\nimport { NetworkStatus, isNetworkRequestInFlight } from \"./networkStatus.js\";\nimport { LocalState } from \"./LocalState.js\";\nimport { QueryInfo, shouldWriteResult, } from \"./QueryInfo.js\";\nimport { PROTOCOL_ERRORS_SYMBOL } from \"../errors/index.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar QueryManager = (function () {\n function QueryManager(_a) {\n var cache = _a.cache, link = _a.link, defaultOptions = _a.defaultOptions, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, onBroadcast = _a.onBroadcast, _c = _a.ssrMode, ssrMode = _c === void 0 ? false : _c, _d = _a.clientAwareness, clientAwareness = _d === void 0 ? {} : _d, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults;\n this.clientAwareness = {};\n this.queries = new Map();\n this.fetchCancelFns = new Map();\n this.transformCache = new (canUseWeakMap ? WeakMap : Map)();\n this.queryIdCounter = 1;\n this.requestIdCounter = 1;\n this.mutationIdCounter = 1;\n this.inFlightLinkObservables = new Map();\n this.cache = cache;\n this.link = link;\n this.defaultOptions = defaultOptions || Object.create(null);\n this.queryDeduplication = queryDeduplication;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: cache });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n if ((this.onBroadcast = onBroadcast)) {\n this.mutationStore = Object.create(null);\n }\n }\n QueryManager.prototype.stop = function () {\n var _this = this;\n this.queries.forEach(function (_info, queryId) {\n _this.stopQueryNoBroadcast(queryId);\n });\n this.cancelPendingFetches(__DEV__ ? new InvariantError('QueryManager stopped while query was in flight') : new InvariantError(14));\n };\n QueryManager.prototype.cancelPendingFetches = function (error) {\n this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });\n this.fetchCancelFns.clear();\n };\n QueryManager.prototype.mutate = function (_a) {\n var _b, _c;\n var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueries = _a.updateQueries, _d = _a.refetchQueries, refetchQueries = _d === void 0 ? [] : _d, _e = _a.awaitRefetchQueries, awaitRefetchQueries = _e === void 0 ? false : _e, updateWithProxyFn = _a.update, onQueryUpdated = _a.onQueryUpdated, _f = _a.fetchPolicy, fetchPolicy = _f === void 0 ? ((_b = this.defaultOptions.mutate) === null || _b === void 0 ? void 0 : _b.fetchPolicy) || \"network-only\" : _f, _g = _a.errorPolicy, errorPolicy = _g === void 0 ? ((_c = this.defaultOptions.mutate) === null || _c === void 0 ? void 0 : _c.errorPolicy) || \"none\" : _g, keepRootFields = _a.keepRootFields, context = _a.context;\n return __awaiter(this, void 0, void 0, function () {\n var mutationId, _h, document, hasClientExports, mutationStoreValue, self;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n __DEV__ ? invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.') : invariant(mutation, 15);\n __DEV__ ? invariant(fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache', \"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write.\") : invariant(fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache', 16);\n mutationId = this.generateMutationId();\n _h = this.transform(mutation), document = _h.document, hasClientExports = _h.hasClientExports;\n mutation = this.cache.transformForLink(document);\n variables = this.getVariables(mutation, variables);\n if (!hasClientExports) return [3, 2];\n return [4, this.localState.addExportedVariables(mutation, variables, context)];\n case 1:\n variables = (_j.sent());\n _j.label = 2;\n case 2:\n mutationStoreValue = this.mutationStore &&\n (this.mutationStore[mutationId] = {\n mutation: mutation,\n variables: variables,\n loading: true,\n error: null,\n });\n if (optimisticResponse) {\n this.markMutationOptimistic(optimisticResponse, {\n mutationId: mutationId,\n document: mutation,\n variables: variables,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n context: context,\n updateQueries: updateQueries,\n update: updateWithProxyFn,\n keepRootFields: keepRootFields,\n });\n }\n this.broadcastQueries();\n self = this;\n return [2, new Promise(function (resolve, reject) {\n return asyncMap(self.getObservableFromLink(mutation, __assign(__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false), function (result) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n throw new ApolloError({\n graphQLErrors: getGraphQLErrorsFromResult(result),\n });\n }\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = null;\n }\n var storeResult = __assign({}, result);\n if (typeof refetchQueries === \"function\") {\n refetchQueries = refetchQueries(storeResult);\n }\n if (errorPolicy === 'ignore' &&\n graphQLResultHasError(storeResult)) {\n delete storeResult.errors;\n }\n return self.markMutationResult({\n mutationId: mutationId,\n result: storeResult,\n document: mutation,\n variables: variables,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n context: context,\n update: updateWithProxyFn,\n updateQueries: updateQueries,\n awaitRefetchQueries: awaitRefetchQueries,\n refetchQueries: refetchQueries,\n removeOptimistic: optimisticResponse ? mutationId : void 0,\n onQueryUpdated: onQueryUpdated,\n keepRootFields: keepRootFields,\n });\n }).subscribe({\n next: function (storeResult) {\n self.broadcastQueries();\n if (!('hasNext' in storeResult) || storeResult.hasNext === false) {\n resolve(storeResult);\n }\n },\n error: function (err) {\n if (mutationStoreValue) {\n mutationStoreValue.loading = false;\n mutationStoreValue.error = err;\n }\n if (optimisticResponse) {\n self.cache.removeOptimistic(mutationId);\n }\n self.broadcastQueries();\n reject(err instanceof ApolloError ? err : new ApolloError({\n networkError: err,\n }));\n },\n });\n })];\n }\n });\n });\n };\n QueryManager.prototype.markMutationResult = function (mutation, cache) {\n var _this = this;\n if (cache === void 0) { cache = this.cache; }\n var result = mutation.result;\n var cacheWrites = [];\n var skipCache = mutation.fetchPolicy === \"no-cache\";\n if (!skipCache && shouldWriteResult(result, mutation.errorPolicy)) {\n if (!isExecutionPatchIncrementalResult(result)) {\n cacheWrites.push({\n result: result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n });\n }\n if (isExecutionPatchIncrementalResult(result) && isNonEmptyArray(result.incremental)) {\n var diff = cache.diff({\n id: \"ROOT_MUTATION\",\n query: this.transform(mutation.document).asQuery,\n variables: mutation.variables,\n optimistic: false,\n returnPartialData: true,\n });\n var mergedData = void 0;\n if (diff.result) {\n mergedData = mergeIncrementalData(diff.result, result);\n }\n if (typeof mergedData !== 'undefined') {\n result.data = mergedData;\n cacheWrites.push({\n result: mergedData,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n });\n }\n }\n var updateQueries_1 = mutation.updateQueries;\n if (updateQueries_1) {\n this.queries.forEach(function (_a, queryId) {\n var observableQuery = _a.observableQuery;\n var queryName = observableQuery && observableQuery.queryName;\n if (!queryName || !hasOwnProperty.call(updateQueries_1, queryName)) {\n return;\n }\n var updater = updateQueries_1[queryName];\n var _b = _this.queries.get(queryId), document = _b.document, variables = _b.variables;\n var _c = cache.diff({\n query: document,\n variables: variables,\n returnPartialData: true,\n optimistic: false,\n }), currentQueryResult = _c.result, complete = _c.complete;\n if (complete && currentQueryResult) {\n var nextQueryResult = updater(currentQueryResult, {\n mutationResult: result,\n queryName: document && getOperationName(document) || void 0,\n queryVariables: variables,\n });\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n });\n }\n }\n if (cacheWrites.length > 0 ||\n mutation.refetchQueries ||\n mutation.update ||\n mutation.onQueryUpdated ||\n mutation.removeOptimistic) {\n var results_1 = [];\n this.refetchQueries({\n updateCache: function (cache) {\n if (!skipCache) {\n cacheWrites.forEach(function (write) { return cache.write(write); });\n }\n var update = mutation.update;\n var isFinalResult = !isExecutionPatchResult(result) ||\n (isExecutionPatchIncrementalResult(result) && !result.hasNext);\n if (update) {\n if (!skipCache) {\n var diff = cache.diff({\n id: \"ROOT_MUTATION\",\n query: _this.transform(mutation.document).asQuery,\n variables: mutation.variables,\n optimistic: false,\n returnPartialData: true,\n });\n if (diff.complete) {\n result = __assign(__assign({}, result), { data: diff.result });\n if ('incremental' in result) {\n delete result.incremental;\n }\n if ('hasNext' in result) {\n delete result.hasNext;\n }\n }\n }\n if (isFinalResult) {\n update(cache, result, {\n context: mutation.context,\n variables: mutation.variables,\n });\n }\n }\n if (!skipCache && !mutation.keepRootFields && isFinalResult) {\n cache.modify({\n id: 'ROOT_MUTATION',\n fields: function (value, _a) {\n var fieldName = _a.fieldName, DELETE = _a.DELETE;\n return fieldName === \"__typename\" ? value : DELETE;\n },\n });\n }\n },\n include: mutation.refetchQueries,\n optimistic: false,\n removeOptimistic: mutation.removeOptimistic,\n onQueryUpdated: mutation.onQueryUpdated || null,\n }).forEach(function (result) { return results_1.push(result); });\n if (mutation.awaitRefetchQueries || mutation.onQueryUpdated) {\n return Promise.all(results_1).then(function () { return result; });\n }\n }\n return Promise.resolve(result);\n };\n QueryManager.prototype.markMutationOptimistic = function (optimisticResponse, mutation) {\n var _this = this;\n var data = typeof optimisticResponse === \"function\"\n ? optimisticResponse(mutation.variables)\n : optimisticResponse;\n return this.cache.recordOptimisticTransaction(function (cache) {\n try {\n _this.markMutationResult(__assign(__assign({}, mutation), { result: { data: data } }), cache);\n }\n catch (error) {\n __DEV__ && invariant.error(error);\n }\n }, mutation.mutationId);\n };\n QueryManager.prototype.fetchQuery = function (queryId, options, networkStatus) {\n return this.fetchQueryObservable(queryId, options, networkStatus).promise;\n };\n QueryManager.prototype.getQueryStore = function () {\n var store = Object.create(null);\n this.queries.forEach(function (info, queryId) {\n store[queryId] = {\n variables: info.variables,\n networkStatus: info.networkStatus,\n networkError: info.networkError,\n graphQLErrors: info.graphQLErrors,\n };\n });\n return store;\n };\n QueryManager.prototype.resetErrors = function (queryId) {\n var queryInfo = this.queries.get(queryId);\n if (queryInfo) {\n queryInfo.networkError = undefined;\n queryInfo.graphQLErrors = [];\n }\n };\n QueryManager.prototype.transform = function (document) {\n var transformCache = this.transformCache;\n if (!transformCache.has(document)) {\n var transformed = this.cache.transformDocument(document);\n var noConnection = removeConnectionDirectiveFromDocument(transformed);\n var clientQuery = this.localState.clientQuery(transformed);\n var serverQuery = noConnection && this.localState.serverQuery(noConnection);\n var cacheEntry_1 = {\n document: transformed,\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery: clientQuery,\n serverQuery: serverQuery,\n defaultVars: getDefaultValues(getOperationDefinition(transformed)),\n asQuery: __assign(__assign({}, transformed), { definitions: transformed.definitions.map(function (def) {\n if (def.kind === \"OperationDefinition\" &&\n def.operation !== \"query\") {\n return __assign(__assign({}, def), { operation: \"query\" });\n }\n return def;\n }) })\n };\n var add = function (doc) {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry_1);\n }\n };\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n return transformCache.get(document);\n };\n QueryManager.prototype.getVariables = function (document, variables) {\n return __assign(__assign({}, this.transform(document).defaultVars), variables);\n };\n QueryManager.prototype.watchQuery = function (options) {\n options = __assign(__assign({}, options), { variables: this.getVariables(options.query, options.variables) });\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n var queryInfo = new QueryInfo(this);\n var observable = new ObservableQuery({\n queryManager: this,\n queryInfo: queryInfo,\n options: options,\n });\n this.queries.set(observable.queryId, queryInfo);\n queryInfo.init({\n document: observable.query,\n observableQuery: observable,\n variables: observable.variables,\n });\n return observable;\n };\n QueryManager.prototype.query = function (options, queryId) {\n var _this = this;\n if (queryId === void 0) { queryId = this.generateQueryId(); }\n __DEV__ ? invariant(options.query, 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.') : invariant(options.query, 17);\n __DEV__ ? invariant(options.query.kind === 'Document', 'You must wrap the query string in a \"gql\" tag.') : invariant(options.query.kind === 'Document', 18);\n __DEV__ ? invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.') : invariant(!options.returnPartialData, 19);\n __DEV__ ? invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.') : invariant(!options.pollInterval, 20);\n return this.fetchQuery(queryId, options).finally(function () { return _this.stopQuery(queryId); });\n };\n QueryManager.prototype.generateQueryId = function () {\n return String(this.queryIdCounter++);\n };\n QueryManager.prototype.generateRequestId = function () {\n return this.requestIdCounter++;\n };\n QueryManager.prototype.generateMutationId = function () {\n return String(this.mutationIdCounter++);\n };\n QueryManager.prototype.stopQueryInStore = function (queryId) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n };\n QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) {\n var queryInfo = this.queries.get(queryId);\n if (queryInfo)\n queryInfo.stop();\n };\n QueryManager.prototype.clearStore = function (options) {\n if (options === void 0) { options = {\n discardWatches: true,\n }; }\n this.cancelPendingFetches(__DEV__ ? new InvariantError('Store reset while query was in flight (not completed in link chain)') : new InvariantError(21));\n this.queries.forEach(function (queryInfo) {\n if (queryInfo.observableQuery) {\n queryInfo.networkStatus = NetworkStatus.loading;\n }\n else {\n queryInfo.stop();\n }\n });\n if (this.mutationStore) {\n this.mutationStore = Object.create(null);\n }\n return this.cache.reset(options);\n };\n QueryManager.prototype.getObservableQueries = function (include) {\n var _this = this;\n if (include === void 0) { include = \"active\"; }\n var queries = new Map();\n var queryNamesAndDocs = new Map();\n var legacyQueryOptions = new Set();\n if (Array.isArray(include)) {\n include.forEach(function (desc) {\n if (typeof desc === \"string\") {\n queryNamesAndDocs.set(desc, false);\n }\n else if (isDocumentNode(desc)) {\n queryNamesAndDocs.set(_this.transform(desc).document, false);\n }\n else if (isNonNullObject(desc) && desc.query) {\n legacyQueryOptions.add(desc);\n }\n });\n }\n this.queries.forEach(function (_a, queryId) {\n var oq = _a.observableQuery, document = _a.document;\n if (oq) {\n if (include === \"all\") {\n queries.set(queryId, oq);\n return;\n }\n var queryName = oq.queryName, fetchPolicy = oq.options.fetchPolicy;\n if (fetchPolicy === \"standby\" ||\n (include === \"active\" && !oq.hasObservers())) {\n return;\n }\n if (include === \"active\" ||\n (queryName && queryNamesAndDocs.has(queryName)) ||\n (document && queryNamesAndDocs.has(document))) {\n queries.set(queryId, oq);\n if (queryName)\n queryNamesAndDocs.set(queryName, true);\n if (document)\n queryNamesAndDocs.set(document, true);\n }\n }\n });\n if (legacyQueryOptions.size) {\n legacyQueryOptions.forEach(function (options) {\n var queryId = makeUniqueId(\"legacyOneTimeQuery\");\n var queryInfo = _this.getQuery(queryId).init({\n document: options.query,\n variables: options.variables,\n });\n var oq = new ObservableQuery({\n queryManager: _this,\n queryInfo: queryInfo,\n options: __assign(__assign({}, options), { fetchPolicy: \"network-only\" }),\n });\n invariant(oq.queryId === queryId);\n queryInfo.setObservableQuery(oq);\n queries.set(queryId, oq);\n });\n }\n if (__DEV__ && queryNamesAndDocs.size) {\n queryNamesAndDocs.forEach(function (included, nameOrDoc) {\n if (!included) {\n __DEV__ && invariant.warn(\"Unknown query \".concat(typeof nameOrDoc === \"string\" ? \"named \" : \"\").concat(JSON.stringify(nameOrDoc, null, 2), \" requested in refetchQueries options.include array\"));\n }\n });\n }\n return queries;\n };\n QueryManager.prototype.reFetchObservableQueries = function (includeStandby) {\n var _this = this;\n if (includeStandby === void 0) { includeStandby = false; }\n var observableQueryPromises = [];\n this.getObservableQueries(includeStandby ? \"all\" : \"active\").forEach(function (observableQuery, queryId) {\n var fetchPolicy = observableQuery.options.fetchPolicy;\n observableQuery.resetLastResults();\n if (includeStandby ||\n (fetchPolicy !== \"standby\" &&\n fetchPolicy !== \"cache-only\")) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n _this.getQuery(queryId).setDiff(null);\n });\n this.broadcastQueries();\n return Promise.all(observableQueryPromises);\n };\n QueryManager.prototype.setObservableQuery = function (observableQuery) {\n this.getQuery(observableQuery.queryId).setObservableQuery(observableQuery);\n };\n QueryManager.prototype.startGraphQLSubscription = function (_a) {\n var _this = this;\n var query = _a.query, fetchPolicy = _a.fetchPolicy, errorPolicy = _a.errorPolicy, variables = _a.variables, _b = _a.context, context = _b === void 0 ? {} : _b;\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n var makeObservable = function (variables) {\n return _this.getObservableFromLink(query, context, variables).map(function (result) {\n if (fetchPolicy !== 'no-cache') {\n if (shouldWriteResult(result, errorPolicy)) {\n _this.cache.write({\n query: query,\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n variables: variables,\n });\n }\n _this.broadcastQueries();\n }\n var hasErrors = graphQLResultHasError(result);\n var hasProtocolErrors = graphQLResultHasProtocolErrors(result);\n if (hasErrors || hasProtocolErrors) {\n var errors = {};\n if (hasErrors) {\n errors.graphQLErrors = result.errors;\n }\n if (hasProtocolErrors) {\n errors.protocolErrors = result.extensions[PROTOCOL_ERRORS_SYMBOL];\n }\n throw new ApolloError(errors);\n }\n return result;\n });\n };\n if (this.transform(query).hasClientExports) {\n var observablePromise_1 = this.localState.addExportedVariables(query, variables, context).then(makeObservable);\n return new Observable(function (observer) {\n var sub = null;\n observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error);\n return function () { return sub && sub.unsubscribe(); };\n });\n }\n return makeObservable(variables);\n };\n QueryManager.prototype.stopQuery = function (queryId) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n };\n QueryManager.prototype.stopQueryNoBroadcast = function (queryId) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n };\n QueryManager.prototype.removeQuery = function (queryId) {\n this.fetchCancelFns.delete(queryId);\n if (this.queries.has(queryId)) {\n this.getQuery(queryId).stop();\n this.queries.delete(queryId);\n }\n };\n QueryManager.prototype.broadcastQueries = function () {\n if (this.onBroadcast)\n this.onBroadcast();\n this.queries.forEach(function (info) { return info.notify(); });\n };\n QueryManager.prototype.getLocalState = function () {\n return this.localState;\n };\n QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) {\n var _this = this;\n var _a;\n if (deduplication === void 0) { deduplication = (_a = context === null || context === void 0 ? void 0 : context.queryDeduplication) !== null && _a !== void 0 ? _a : this.queryDeduplication; }\n var observable;\n var serverQuery = this.transform(query).serverQuery;\n if (serverQuery) {\n var _b = this, inFlightLinkObservables_1 = _b.inFlightLinkObservables, link = _b.link;\n var operation = {\n query: serverQuery,\n variables: variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext(__assign(__assign({}, context), { forceFetch: !deduplication })),\n };\n context = operation.context;\n if (deduplication) {\n var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map();\n inFlightLinkObservables_1.set(serverQuery, byVariables_1);\n var varJson_1 = canonicalStringify(variables);\n observable = byVariables_1.get(varJson_1);\n if (!observable) {\n var concast = new Concast([\n execute(link, operation)\n ]);\n byVariables_1.set(varJson_1, observable = concast);\n concast.beforeNext(function () {\n if (byVariables_1.delete(varJson_1) &&\n byVariables_1.size < 1) {\n inFlightLinkObservables_1.delete(serverQuery);\n }\n });\n }\n }\n else {\n observable = new Concast([\n execute(link, operation)\n ]);\n }\n }\n else {\n observable = new Concast([\n Observable.of({ data: {} })\n ]);\n context = this.prepareContext(context);\n }\n var clientQuery = this.transform(query).clientQuery;\n if (clientQuery) {\n observable = asyncMap(observable, function (result) {\n return _this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context: context,\n variables: variables,\n });\n });\n }\n return observable;\n };\n QueryManager.prototype.getResultsFromLink = function (queryInfo, cacheWriteBehavior, options) {\n var requestId = queryInfo.lastRequestId = this.generateRequestId();\n var linkDocument = this.cache.transformForLink(this.transform(queryInfo.document).document);\n return asyncMap(this.getObservableFromLink(linkDocument, options.context, options.variables), function (result) {\n var graphQLErrors = getGraphQLErrorsFromResult(result);\n var hasErrors = graphQLErrors.length > 0;\n if (requestId >= queryInfo.lastRequestId) {\n if (hasErrors && options.errorPolicy === \"none\") {\n throw queryInfo.markError(new ApolloError({\n graphQLErrors: graphQLErrors,\n }));\n }\n queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);\n queryInfo.markReady();\n }\n var aqr = {\n data: result.data,\n loading: false,\n networkStatus: NetworkStatus.ready,\n };\n if (hasErrors && options.errorPolicy !== \"ignore\") {\n aqr.errors = graphQLErrors;\n aqr.networkStatus = NetworkStatus.error;\n }\n return aqr;\n }, function (networkError) {\n var error = isApolloError(networkError)\n ? networkError\n : new ApolloError({ networkError: networkError });\n if (requestId >= queryInfo.lastRequestId) {\n queryInfo.markError(error);\n }\n throw error;\n });\n };\n QueryManager.prototype.fetchQueryObservable = function (queryId, options, networkStatus) {\n return this.fetchConcastWithInfo(queryId, options, networkStatus).concast;\n };\n QueryManager.prototype.fetchConcastWithInfo = function (queryId, options, networkStatus) {\n var _this = this;\n if (networkStatus === void 0) { networkStatus = NetworkStatus.loading; }\n var query = this.transform(options.query).document;\n var variables = this.getVariables(query, options.variables);\n var queryInfo = this.getQuery(queryId);\n var defaults = this.defaultOptions.watchQuery;\n var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? defaults && defaults.fetchPolicy || \"cache-first\" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? defaults && defaults.errorPolicy || \"none\" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e;\n var normalized = Object.assign({}, options, {\n query: query,\n variables: variables,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n returnPartialData: returnPartialData,\n notifyOnNetworkStatusChange: notifyOnNetworkStatusChange,\n context: context,\n });\n var fromVariables = function (variables) {\n normalized.variables = variables;\n var sourcesWithInfo = _this.fetchQueryByPolicy(queryInfo, normalized, networkStatus);\n if (normalized.fetchPolicy !== \"standby\" &&\n sourcesWithInfo.sources.length > 0 &&\n queryInfo.observableQuery) {\n queryInfo.observableQuery[\"applyNextFetchPolicy\"](\"after-fetch\", options);\n }\n return sourcesWithInfo;\n };\n var cleanupCancelFn = function () { return _this.fetchCancelFns.delete(queryId); };\n this.fetchCancelFns.set(queryId, function (reason) {\n cleanupCancelFn();\n setTimeout(function () { return concast.cancel(reason); });\n });\n var concast, containsDataFromLink;\n if (this.transform(normalized.query).hasClientExports) {\n concast = new Concast(this.localState\n .addExportedVariables(normalized.query, normalized.variables, normalized.context)\n .then(fromVariables).then(function (sourcesWithInfo) { return sourcesWithInfo.sources; }));\n containsDataFromLink = true;\n }\n else {\n var sourcesWithInfo = fromVariables(normalized.variables);\n containsDataFromLink = sourcesWithInfo.fromLink;\n concast = new Concast(sourcesWithInfo.sources);\n }\n concast.promise.then(cleanupCancelFn, cleanupCancelFn);\n return {\n concast: concast,\n fromLink: containsDataFromLink,\n };\n };\n QueryManager.prototype.refetchQueries = function (_a) {\n var _this = this;\n var updateCache = _a.updateCache, include = _a.include, _b = _a.optimistic, optimistic = _b === void 0 ? false : _b, _c = _a.removeOptimistic, removeOptimistic = _c === void 0 ? optimistic ? makeUniqueId(\"refetchQueries\") : void 0 : _c, onQueryUpdated = _a.onQueryUpdated;\n var includedQueriesById = new Map();\n if (include) {\n this.getObservableQueries(include).forEach(function (oq, queryId) {\n includedQueriesById.set(queryId, {\n oq: oq,\n lastDiff: _this.getQuery(queryId).getDiff(),\n });\n });\n }\n var results = new Map;\n if (updateCache) {\n this.cache.batch({\n update: updateCache,\n optimistic: optimistic && removeOptimistic || false,\n removeOptimistic: removeOptimistic,\n onWatchUpdated: function (watch, diff, lastDiff) {\n var oq = watch.watcher instanceof QueryInfo &&\n watch.watcher.observableQuery;\n if (oq) {\n if (onQueryUpdated) {\n includedQueriesById.delete(oq.queryId);\n var result = onQueryUpdated(oq, diff, lastDiff);\n if (result === true) {\n result = oq.refetch();\n }\n if (result !== false) {\n results.set(oq, result);\n }\n return result;\n }\n if (onQueryUpdated !== null) {\n includedQueriesById.set(oq.queryId, { oq: oq, lastDiff: lastDiff, diff: diff });\n }\n }\n },\n });\n }\n if (includedQueriesById.size) {\n includedQueriesById.forEach(function (_a, queryId) {\n var oq = _a.oq, lastDiff = _a.lastDiff, diff = _a.diff;\n var result;\n if (onQueryUpdated) {\n if (!diff) {\n var info = oq[\"queryInfo\"];\n info.reset();\n diff = info.getDiff();\n }\n result = onQueryUpdated(oq, diff, lastDiff);\n }\n if (!onQueryUpdated || result === true) {\n result = oq.refetch();\n }\n if (result !== false) {\n results.set(oq, result);\n }\n if (queryId.indexOf(\"legacyOneTimeQuery\") >= 0) {\n _this.stopQueryNoBroadcast(queryId);\n }\n });\n }\n if (removeOptimistic) {\n this.cache.removeOptimistic(removeOptimistic);\n }\n return results;\n };\n QueryManager.prototype.fetchQueryByPolicy = function (queryInfo, _a, networkStatus) {\n var _this = this;\n var query = _a.query, variables = _a.variables, fetchPolicy = _a.fetchPolicy, refetchWritePolicy = _a.refetchWritePolicy, errorPolicy = _a.errorPolicy, returnPartialData = _a.returnPartialData, context = _a.context, notifyOnNetworkStatusChange = _a.notifyOnNetworkStatusChange;\n var oldNetworkStatus = queryInfo.networkStatus;\n queryInfo.init({\n document: this.transform(query).document,\n variables: variables,\n networkStatus: networkStatus,\n });\n var readCache = function () { return queryInfo.getDiff(variables); };\n var resultsFromCache = function (diff, networkStatus) {\n if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || NetworkStatus.loading; }\n var data = diff.result;\n if (__DEV__ &&\n !returnPartialData &&\n !equal(data, {})) {\n logMissingFieldErrors(diff.missing);\n }\n var fromData = function (data) { return Observable.of(__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };\n if (data && _this.transform(query).hasForcedResolvers) {\n return _this.localState.runResolvers({\n document: query,\n remoteResult: { data: data },\n context: context,\n variables: variables,\n onlyRunForcedResolvers: true,\n }).then(function (resolved) { return fromData(resolved.data || void 0); });\n }\n if (errorPolicy === 'none' &&\n networkStatus === NetworkStatus.refetch &&\n Array.isArray(diff.missing)) {\n return fromData(void 0);\n }\n return fromData(data);\n };\n var cacheWriteBehavior = fetchPolicy === \"no-cache\" ? 0 :\n (networkStatus === NetworkStatus.refetch &&\n refetchWritePolicy !== \"merge\") ? 1\n : 2;\n var resultsFromLink = function () { return _this.getResultsFromLink(queryInfo, cacheWriteBehavior, {\n variables: variables,\n context: context,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n }); };\n var shouldNotify = notifyOnNetworkStatusChange &&\n typeof oldNetworkStatus === \"number\" &&\n oldNetworkStatus !== networkStatus &&\n isNetworkRequestInFlight(networkStatus);\n switch (fetchPolicy) {\n default:\n case \"cache-first\": {\n var diff = readCache();\n if (diff.complete) {\n return { fromLink: false, sources: [resultsFromCache(diff, queryInfo.markReady())] };\n }\n if (returnPartialData || shouldNotify) {\n return { fromLink: true, sources: [resultsFromCache(diff), resultsFromLink()] };\n }\n return { fromLink: true, sources: [resultsFromLink()] };\n }\n case \"cache-and-network\": {\n var diff = readCache();\n if (diff.complete || returnPartialData || shouldNotify) {\n return { fromLink: true, sources: [resultsFromCache(diff), resultsFromLink()] };\n }\n return { fromLink: true, sources: [resultsFromLink()] };\n }\n case \"cache-only\":\n return { fromLink: false, sources: [resultsFromCache(readCache(), queryInfo.markReady())] };\n case \"network-only\":\n if (shouldNotify) {\n return { fromLink: true, sources: [resultsFromCache(readCache()), resultsFromLink()] };\n }\n return { fromLink: true, sources: [resultsFromLink()] };\n case \"no-cache\":\n if (shouldNotify) {\n return {\n fromLink: true,\n sources: [\n resultsFromCache(queryInfo.getDiff()),\n resultsFromLink(),\n ],\n };\n }\n return { fromLink: true, sources: [resultsFromLink()] };\n case \"standby\":\n return { fromLink: false, sources: [] };\n }\n };\n QueryManager.prototype.getQuery = function (queryId) {\n if (queryId && !this.queries.has(queryId)) {\n this.queries.set(queryId, new QueryInfo(this, queryId));\n }\n return this.queries.get(queryId);\n };\n QueryManager.prototype.prepareContext = function (context) {\n if (context === void 0) { context = {}; }\n var newContext = this.localState.prepareContext(context);\n return __assign(__assign({}, newContext), { clientAwareness: this.clientAwareness });\n };\n return QueryManager;\n}());\nexport { QueryManager };\n//# sourceMappingURL=QueryManager.js.map","import { __assign } from \"tslib\";\nimport { invariant, InvariantError } from \"../utilities/globals/index.js\";\nimport { ApolloLink, execute } from \"../link/core/index.js\";\nimport { version } from \"../version.js\";\nimport { HttpLink } from \"../link/http/index.js\";\nimport { QueryManager } from \"./QueryManager.js\";\nimport { LocalState, } from \"./LocalState.js\";\nvar hasSuggestedDevtools = false;\nimport { mergeOptions } from \"../utilities/index.js\";\nexport { mergeOptions };\nvar ApolloClient = (function () {\n function ApolloClient(options) {\n var _this = this;\n this.resetStoreCallbacks = [];\n this.clearStoreCallbacks = [];\n var uri = options.uri, credentials = options.credentials, headers = options.headers, cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, _c = options.connectToDevTools, connectToDevTools = _c === void 0 ? typeof window === 'object' &&\n !window.__APOLLO_CLIENT__ &&\n __DEV__ : _c, _d = options.queryDeduplication, queryDeduplication = _d === void 0 ? true : _d, defaultOptions = options.defaultOptions, _e = options.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? false : _e, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version;\n var link = options.link;\n if (!link) {\n link = uri\n ? new HttpLink({ uri: uri, credentials: credentials, headers: headers })\n : ApolloLink.empty();\n }\n if (!cache) {\n throw __DEV__ ? new InvariantError(\"To initialize Apollo Client, you must specify a 'cache' property \" +\n \"in the options object. \\n\" +\n \"For more information, please visit: https://go.apollo.dev/c/docs\") : new InvariantError(9);\n }\n this.link = link;\n this.cache = cache;\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || Object.create(null);\n this.typeDefs = typeDefs;\n if (ssrForceFetchDelay) {\n setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay);\n }\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n if (connectToDevTools && typeof window === 'object') {\n window.__APOLLO_CLIENT__ = this;\n }\n if (!hasSuggestedDevtools && connectToDevTools && __DEV__) {\n hasSuggestedDevtools = true;\n if (typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self &&\n !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {\n var nav = window.navigator;\n var ua = nav && nav.userAgent;\n var url = void 0;\n if (typeof ua === \"string\") {\n if (ua.indexOf(\"Chrome/\") > -1) {\n url = \"https://chrome.google.com/webstore/detail/\" +\n \"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm\";\n }\n else if (ua.indexOf(\"Firefox/\") > -1) {\n url = \"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/\";\n }\n }\n if (url) {\n __DEV__ && invariant.log(\"Download the Apollo DevTools for a better development \" +\n \"experience: \" + url);\n }\n }\n }\n this.version = version;\n this.localState = new LocalState({\n cache: cache,\n client: this,\n resolvers: resolvers,\n fragmentMatcher: fragmentMatcher,\n });\n this.queryManager = new QueryManager({\n cache: this.cache,\n link: this.link,\n defaultOptions: this.defaultOptions,\n queryDeduplication: queryDeduplication,\n ssrMode: ssrMode,\n clientAwareness: {\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n },\n localState: this.localState,\n assumeImmutableResults: assumeImmutableResults,\n onBroadcast: connectToDevTools ? function () {\n if (_this.devToolsHookCb) {\n _this.devToolsHookCb({\n action: {},\n state: {\n queries: _this.queryManager.getQueryStore(),\n mutations: _this.queryManager.mutationStore || {},\n },\n dataWithOptimisticResults: _this.cache.extract(true),\n });\n }\n } : void 0,\n });\n }\n ApolloClient.prototype.stop = function () {\n this.queryManager.stop();\n };\n ApolloClient.prototype.watchQuery = function (options) {\n if (this.defaultOptions.watchQuery) {\n options = mergeOptions(this.defaultOptions.watchQuery, options);\n }\n if (this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')) {\n options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });\n }\n return this.queryManager.watchQuery(options);\n };\n ApolloClient.prototype.query = function (options) {\n if (this.defaultOptions.query) {\n options = mergeOptions(this.defaultOptions.query, options);\n }\n __DEV__ ? invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.') : invariant(options.fetchPolicy !== 'cache-and-network', 10);\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });\n }\n return this.queryManager.query(options);\n };\n ApolloClient.prototype.mutate = function (options) {\n if (this.defaultOptions.mutate) {\n options = mergeOptions(this.defaultOptions.mutate, options);\n }\n return this.queryManager.mutate(options);\n };\n ApolloClient.prototype.subscribe = function (options) {\n return this.queryManager.startGraphQLSubscription(options);\n };\n ApolloClient.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return this.cache.readQuery(options, optimistic);\n };\n ApolloClient.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) { optimistic = false; }\n return this.cache.readFragment(options, optimistic);\n };\n ApolloClient.prototype.writeQuery = function (options) {\n var ref = this.cache.writeQuery(options);\n if (options.broadcast !== false) {\n this.queryManager.broadcastQueries();\n }\n return ref;\n };\n ApolloClient.prototype.writeFragment = function (options) {\n var ref = this.cache.writeFragment(options);\n if (options.broadcast !== false) {\n this.queryManager.broadcastQueries();\n }\n return ref;\n };\n ApolloClient.prototype.__actionHookForDevTools = function (cb) {\n this.devToolsHookCb = cb;\n };\n ApolloClient.prototype.__requestRaw = function (payload) {\n return execute(this.link, payload);\n };\n ApolloClient.prototype.resetStore = function () {\n var _this = this;\n return Promise.resolve()\n .then(function () { return _this.queryManager.clearStore({\n discardWatches: false,\n }); })\n .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); })\n .then(function () { return _this.reFetchObservableQueries(); });\n };\n ApolloClient.prototype.clearStore = function () {\n var _this = this;\n return Promise.resolve()\n .then(function () { return _this.queryManager.clearStore({\n discardWatches: true,\n }); })\n .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); });\n };\n ApolloClient.prototype.onResetStore = function (cb) {\n var _this = this;\n this.resetStoreCallbacks.push(cb);\n return function () {\n _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; });\n };\n };\n ApolloClient.prototype.onClearStore = function (cb) {\n var _this = this;\n this.clearStoreCallbacks.push(cb);\n return function () {\n _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; });\n };\n };\n ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n };\n ApolloClient.prototype.refetchQueries = function (options) {\n var map = this.queryManager.refetchQueries(options);\n var queries = [];\n var results = [];\n map.forEach(function (result, obsQuery) {\n queries.push(obsQuery);\n results.push(result);\n });\n var result = Promise.all(results);\n result.queries = queries;\n result.results = results;\n result.catch(function (error) {\n __DEV__ && invariant.debug(\"In client.refetchQueries, Promise.all promise rejected with error \".concat(error));\n });\n return result;\n };\n ApolloClient.prototype.getObservableQueries = function (include) {\n if (include === void 0) { include = \"active\"; }\n return this.queryManager.getObservableQueries(include);\n };\n ApolloClient.prototype.extract = function (optimistic) {\n return this.cache.extract(optimistic);\n };\n ApolloClient.prototype.restore = function (serializedState) {\n return this.cache.restore(serializedState);\n };\n ApolloClient.prototype.addResolvers = function (resolvers) {\n this.localState.addResolvers(resolvers);\n };\n ApolloClient.prototype.setResolvers = function (resolvers) {\n this.localState.setResolvers(resolvers);\n };\n ApolloClient.prototype.getResolvers = function () {\n return this.localState.getResolvers();\n };\n ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n };\n ApolloClient.prototype.setLink = function (newLink) {\n this.link = this.queryManager.link = newLink;\n };\n return ApolloClient;\n}());\nexport { ApolloClient };\n//# sourceMappingURL=ApolloClient.js.map","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables,\n allowLegacyFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","import * as React from 'react';\nimport { canUseSymbol } from \"../../utilities/index.js\";\nvar contextKey = canUseSymbol\n ? Symbol.for('__APOLLO_CONTEXT__')\n : '__APOLLO_CONTEXT__';\nexport function getApolloContext() {\n var context = React.createContext[contextKey];\n if (!context) {\n Object.defineProperty(React.createContext, contextKey, {\n value: context = React.createContext({}),\n enumerable: false,\n writable: false,\n configurable: true,\n });\n context.displayName = 'ApolloContext';\n }\n return context;\n}\nexport { getApolloContext as resetApolloContext };\n//# sourceMappingURL=ApolloContext.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport * as React from 'react';\nimport { getApolloContext } from \"./ApolloContext.js\";\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n if (context === void 0) { context = {}; }\n if (client && context.client !== client) {\n context = Object.assign({}, context, { client: client });\n }\n __DEV__ ? invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.') : invariant(context.client, 29);\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n }));\n};\n//# sourceMappingURL=ApolloProvider.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport { useContext } from 'react';\nimport { getApolloContext } from \"../context/index.js\";\nexport function useApolloClient(override) {\n var context = useContext(getApolloContext());\n var client = override || context.client;\n __DEV__ ? invariant(!!client, 'Could not find \"client\" in the context or passed in as an option. ' +\n 'Wrap the root component in an , or pass an ApolloClient ' +\n 'instance in via options.') : invariant(!!client, 32);\n return client;\n}\n//# sourceMappingURL=useApolloClient.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport * as React from 'react';\nimport { canUseLayoutEffect } from \"../../utilities/index.js\";\nvar didWarnUncachedGetSnapshot = false;\nvar uSESKey = \"useSyncExternalStore\";\nvar realHook = React[uSESKey];\nexport var useSyncExternalStore = realHook || (function (subscribe, getSnapshot, getServerSnapshot) {\n var value = getSnapshot();\n if (__DEV__ &&\n !didWarnUncachedGetSnapshot &&\n value !== getSnapshot()) {\n didWarnUncachedGetSnapshot = true;\n __DEV__ && invariant.error('The result of getSnapshot should be cached to avoid an infinite loop');\n }\n var _a = React.useState({ inst: { value: value, getSnapshot: getSnapshot } }), inst = _a[0].inst, forceUpdate = _a[1];\n if (canUseLayoutEffect) {\n React.useLayoutEffect(function () {\n Object.assign(inst, { value: value, getSnapshot: getSnapshot });\n if (checkIfSnapshotChanged(inst)) {\n forceUpdate({ inst: inst });\n }\n }, [subscribe, value, getSnapshot]);\n }\n else {\n Object.assign(inst, { value: value, getSnapshot: getSnapshot });\n }\n React.useEffect(function () {\n if (checkIfSnapshotChanged(inst)) {\n forceUpdate({ inst: inst });\n }\n return subscribe(function handleStoreChange() {\n if (checkIfSnapshotChanged(inst)) {\n forceUpdate({ inst: inst });\n }\n });\n }, [subscribe]);\n return value;\n});\nfunction checkIfSnapshotChanged(_a) {\n var value = _a.value, getSnapshot = _a.getSnapshot;\n try {\n return value !== getSnapshot();\n }\n catch (_b) {\n return true;\n }\n}\n//# sourceMappingURL=useSyncExternalStore.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nexport var DocumentType;\n(function (DocumentType) {\n DocumentType[DocumentType[\"Query\"] = 0] = \"Query\";\n DocumentType[DocumentType[\"Mutation\"] = 1] = \"Mutation\";\n DocumentType[DocumentType[\"Subscription\"] = 2] = \"Subscription\";\n})(DocumentType || (DocumentType = {}));\nvar cache = new Map();\nexport function operationName(type) {\n var name;\n switch (type) {\n case DocumentType.Query:\n name = 'Query';\n break;\n case DocumentType.Mutation:\n name = 'Mutation';\n break;\n case DocumentType.Subscription:\n name = 'Subscription';\n break;\n }\n return name;\n}\nexport function parser(document) {\n var cached = cache.get(document);\n if (cached)\n return cached;\n var variables, type, name;\n __DEV__ ? invariant(!!document && !!document.kind, \"Argument of \".concat(document, \" passed to parser was not a valid GraphQL \") +\n \"DocumentNode. You may need to use 'graphql-tag' or another method \" +\n \"to convert your operation into a document\") : invariant(!!document && !!document.kind, 33);\n var fragments = [];\n var queries = [];\n var mutations = [];\n var subscriptions = [];\n for (var _i = 0, _a = document.definitions; _i < _a.length; _i++) {\n var x = _a[_i];\n if (x.kind === 'FragmentDefinition') {\n fragments.push(x);\n continue;\n }\n if (x.kind === 'OperationDefinition') {\n switch (x.operation) {\n case 'query':\n queries.push(x);\n break;\n case 'mutation':\n mutations.push(x);\n break;\n case 'subscription':\n subscriptions.push(x);\n break;\n }\n }\n }\n __DEV__ ? invariant(!fragments.length ||\n (queries.length || mutations.length || subscriptions.length), \"Passing only a fragment to 'graphql' is not yet supported. \" +\n \"You must include a query, subscription or mutation as well\") : invariant(!fragments.length ||\n (queries.length || mutations.length || subscriptions.length), 34);\n __DEV__ ? invariant(queries.length + mutations.length + subscriptions.length <= 1, \"react-apollo only supports a query, subscription, or a mutation per HOC. \" +\n \"\".concat(document, \" had \").concat(queries.length, \" queries, \").concat(subscriptions.length, \" \") +\n \"subscriptions and \".concat(mutations.length, \" mutations. \") +\n \"You can use 'compose' to join multiple operation types to a component\") : invariant(queries.length + mutations.length + subscriptions.length <= 1, 35);\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length)\n type = DocumentType.Subscription;\n var definitions = queries.length\n ? queries\n : mutations.length\n ? mutations\n : subscriptions;\n __DEV__ ? invariant(definitions.length === 1, \"react-apollo only supports one definition per HOC. \".concat(document, \" had \") +\n \"\".concat(definitions.length, \" definitions. \") +\n \"You can use 'compose' to join multiple operation types to a component\") : invariant(definitions.length === 1, 36);\n var definition = definitions[0];\n variables = definition.variableDefinitions || [];\n if (definition.name && definition.name.kind === 'Name') {\n name = definition.name.value;\n }\n else {\n name = 'data';\n }\n var payload = { name: name, type: type, variables: variables };\n cache.set(document, payload);\n return payload;\n}\nexport function verifyDocumentType(document, type) {\n var operation = parser(document);\n var requiredOperationName = operationName(type);\n var usedOperationName = operationName(operation.type);\n __DEV__ ? invariant(operation.type === type, \"Running a \".concat(requiredOperationName, \" requires a graphql \") +\n \"\".concat(requiredOperationName, \", but a \").concat(usedOperationName, \" was used instead.\")) : invariant(operation.type === type, 37);\n}\n//# sourceMappingURL=index.js.map","import { __assign, __rest } from \"tslib\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport { useCallback, useContext, useMemo, useRef, useState, } from 'react';\nimport { useSyncExternalStore } from \"./useSyncExternalStore.js\";\nimport { equal } from '@wry/equality';\nimport { mergeOptions } from \"../../core/index.js\";\nimport { getApolloContext } from \"../context/index.js\";\nimport { ApolloError } from \"../../errors/index.js\";\nimport { NetworkStatus, } from \"../../core/index.js\";\nimport { DocumentType, verifyDocumentType } from \"../parser/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { canUseWeakMap, compact, isNonEmptyArray, maybeDeepFreeze } from \"../../utilities/index.js\";\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function useQuery(query, options) {\n if (options === void 0) { options = Object.create(null); }\n return useInternalState(useApolloClient(options.client), query).useQuery(options);\n}\nexport function useInternalState(client, query) {\n var stateRef = useRef();\n if (!stateRef.current ||\n client !== stateRef.current.client ||\n query !== stateRef.current.query) {\n stateRef.current = new InternalState(client, query, stateRef.current);\n }\n var state = stateRef.current;\n var _a = useState(0), _tick = _a[0], setTick = _a[1];\n state.forceUpdate = function () {\n setTick(function (tick) { return tick + 1; });\n };\n return state;\n}\nvar InternalState = (function () {\n function InternalState(client, query, previous) {\n this.client = client;\n this.query = query;\n this.ssrDisabledResult = maybeDeepFreeze({\n loading: true,\n data: void 0,\n error: void 0,\n networkStatus: NetworkStatus.loading,\n });\n this.skipStandbyResult = maybeDeepFreeze({\n loading: false,\n data: void 0,\n error: void 0,\n networkStatus: NetworkStatus.ready,\n });\n this.toQueryResultCache = new (canUseWeakMap ? WeakMap : Map)();\n verifyDocumentType(query, DocumentType.Query);\n var previousResult = previous && previous.result;\n var previousData = previousResult && previousResult.data;\n if (previousData) {\n this.previousData = previousData;\n }\n }\n InternalState.prototype.forceUpdate = function () {\n __DEV__ && invariant.warn(\"Calling default no-op implementation of InternalState#forceUpdate\");\n };\n InternalState.prototype.executeQuery = function (options) {\n var _this = this;\n var _a;\n if (options.query) {\n Object.assign(this, { query: options.query });\n }\n this.watchQueryOptions = this.createWatchQueryOptions(this.queryHookOptions = options);\n var concast = this.observable.reobserveAsConcast(this.getObsQueryOptions());\n this.previousData = ((_a = this.result) === null || _a === void 0 ? void 0 : _a.data) || this.previousData;\n this.result = void 0;\n this.forceUpdate();\n return new Promise(function (resolve) {\n var result;\n concast.subscribe({\n next: function (value) {\n result = value;\n },\n error: function () {\n resolve(_this.toQueryResult(_this.observable.getCurrentResult()));\n },\n complete: function () {\n resolve(_this.toQueryResult(result));\n }\n });\n });\n };\n InternalState.prototype.useQuery = function (options) {\n var _this = this;\n this.renderPromises = useContext(getApolloContext()).renderPromises;\n this.useOptions(options);\n var obsQuery = this.useObservableQuery();\n var result = useSyncExternalStore(useCallback(function () {\n if (_this.renderPromises) {\n return function () { };\n }\n var onNext = function () {\n var previousResult = _this.result;\n var result = obsQuery.getCurrentResult();\n if (previousResult &&\n previousResult.loading === result.loading &&\n previousResult.networkStatus === result.networkStatus &&\n equal(previousResult.data, result.data)) {\n return;\n }\n _this.setResult(result);\n };\n var onError = function (error) {\n var last = obsQuery[\"last\"];\n subscription.unsubscribe();\n try {\n obsQuery.resetLastResults();\n subscription = obsQuery.subscribe(onNext, onError);\n }\n finally {\n obsQuery[\"last\"] = last;\n }\n if (!hasOwnProperty.call(error, 'graphQLErrors')) {\n throw error;\n }\n var previousResult = _this.result;\n if (!previousResult ||\n (previousResult && previousResult.loading) ||\n !equal(error, previousResult.error)) {\n _this.setResult({\n data: (previousResult && previousResult.data),\n error: error,\n loading: false,\n networkStatus: NetworkStatus.error,\n });\n }\n };\n var subscription = obsQuery.subscribe(onNext, onError);\n return function () { return setTimeout(function () { return subscription.unsubscribe(); }); };\n }, [\n obsQuery,\n this.renderPromises,\n this.client.disableNetworkFetches,\n ]), function () { return _this.getCurrentResult(); }, function () { return _this.getCurrentResult(); });\n this.unsafeHandlePartialRefetch(result);\n return this.toQueryResult(result);\n };\n InternalState.prototype.useOptions = function (options) {\n var _a;\n var watchQueryOptions = this.createWatchQueryOptions(this.queryHookOptions = options);\n var currentWatchQueryOptions = this.watchQueryOptions;\n if (!equal(watchQueryOptions, currentWatchQueryOptions)) {\n this.watchQueryOptions = watchQueryOptions;\n if (currentWatchQueryOptions && this.observable) {\n this.observable.reobserve(this.getObsQueryOptions());\n this.previousData = ((_a = this.result) === null || _a === void 0 ? void 0 : _a.data) || this.previousData;\n this.result = void 0;\n }\n }\n this.onCompleted = options.onCompleted || InternalState.prototype.onCompleted;\n this.onError = options.onError || InternalState.prototype.onError;\n if ((this.renderPromises || this.client.disableNetworkFetches) &&\n this.queryHookOptions.ssr === false &&\n !this.queryHookOptions.skip) {\n this.result = this.ssrDisabledResult;\n }\n else if (this.queryHookOptions.skip ||\n this.watchQueryOptions.fetchPolicy === 'standby') {\n this.result = this.skipStandbyResult;\n }\n else if (this.result === this.ssrDisabledResult ||\n this.result === this.skipStandbyResult) {\n this.result = void 0;\n }\n };\n InternalState.prototype.getObsQueryOptions = function () {\n var toMerge = [];\n var globalDefaults = this.client.defaultOptions.watchQuery;\n if (globalDefaults)\n toMerge.push(globalDefaults);\n if (this.queryHookOptions.defaultOptions) {\n toMerge.push(this.queryHookOptions.defaultOptions);\n }\n toMerge.push(compact(this.observable && this.observable.options, this.watchQueryOptions));\n return toMerge.reduce(mergeOptions);\n };\n InternalState.prototype.createWatchQueryOptions = function (_a) {\n var _b;\n if (_a === void 0) { _a = {}; }\n var skip = _a.skip, ssr = _a.ssr, onCompleted = _a.onCompleted, onError = _a.onError, defaultOptions = _a.defaultOptions, otherOptions = __rest(_a, [\"skip\", \"ssr\", \"onCompleted\", \"onError\", \"defaultOptions\"]);\n var watchQueryOptions = Object.assign(otherOptions, { query: this.query });\n if (this.renderPromises &&\n (watchQueryOptions.fetchPolicy === 'network-only' ||\n watchQueryOptions.fetchPolicy === 'cache-and-network')) {\n watchQueryOptions.fetchPolicy = 'cache-first';\n }\n if (!watchQueryOptions.variables) {\n watchQueryOptions.variables = {};\n }\n if (skip) {\n var _c = watchQueryOptions.fetchPolicy, fetchPolicy = _c === void 0 ? this.getDefaultFetchPolicy() : _c, _d = watchQueryOptions.initialFetchPolicy, initialFetchPolicy = _d === void 0 ? fetchPolicy : _d;\n Object.assign(watchQueryOptions, {\n initialFetchPolicy: initialFetchPolicy,\n fetchPolicy: 'standby',\n });\n }\n else if (!watchQueryOptions.fetchPolicy) {\n watchQueryOptions.fetchPolicy =\n ((_b = this.observable) === null || _b === void 0 ? void 0 : _b.options.initialFetchPolicy) ||\n this.getDefaultFetchPolicy();\n }\n return watchQueryOptions;\n };\n InternalState.prototype.getDefaultFetchPolicy = function () {\n var _a, _b;\n return (((_a = this.queryHookOptions.defaultOptions) === null || _a === void 0 ? void 0 : _a.fetchPolicy) ||\n ((_b = this.client.defaultOptions.watchQuery) === null || _b === void 0 ? void 0 : _b.fetchPolicy) ||\n \"cache-first\");\n };\n InternalState.prototype.onCompleted = function (data) { };\n InternalState.prototype.onError = function (error) { };\n InternalState.prototype.useObservableQuery = function () {\n var obsQuery = this.observable =\n this.renderPromises\n && this.renderPromises.getSSRObservable(this.watchQueryOptions)\n || this.observable\n || this.client.watchQuery(this.getObsQueryOptions());\n this.obsQueryFields = useMemo(function () { return ({\n refetch: obsQuery.refetch.bind(obsQuery),\n reobserve: obsQuery.reobserve.bind(obsQuery),\n fetchMore: obsQuery.fetchMore.bind(obsQuery),\n updateQuery: obsQuery.updateQuery.bind(obsQuery),\n startPolling: obsQuery.startPolling.bind(obsQuery),\n stopPolling: obsQuery.stopPolling.bind(obsQuery),\n subscribeToMore: obsQuery.subscribeToMore.bind(obsQuery),\n }); }, [obsQuery]);\n var ssrAllowed = !(this.queryHookOptions.ssr === false ||\n this.queryHookOptions.skip);\n if (this.renderPromises && ssrAllowed) {\n this.renderPromises.registerSSRObservable(obsQuery);\n if (obsQuery.getCurrentResult().loading) {\n this.renderPromises.addObservableQueryPromise(obsQuery);\n }\n }\n return obsQuery;\n };\n InternalState.prototype.setResult = function (nextResult) {\n var previousResult = this.result;\n if (previousResult && previousResult.data) {\n this.previousData = previousResult.data;\n }\n this.result = nextResult;\n this.forceUpdate();\n this.handleErrorOrCompleted(nextResult);\n };\n InternalState.prototype.handleErrorOrCompleted = function (result) {\n var _this = this;\n if (!result.loading) {\n var error_1 = this.toApolloError(result);\n Promise.resolve().then(function () {\n if (error_1) {\n _this.onError(error_1);\n }\n else if (result.data) {\n _this.onCompleted(result.data);\n }\n }).catch(function (error) {\n __DEV__ && invariant.warn(error);\n });\n }\n };\n InternalState.prototype.toApolloError = function (result) {\n return isNonEmptyArray(result.errors)\n ? new ApolloError({ graphQLErrors: result.errors })\n : result.error;\n };\n InternalState.prototype.getCurrentResult = function () {\n if (!this.result) {\n this.handleErrorOrCompleted(this.result = this.observable.getCurrentResult());\n }\n return this.result;\n };\n InternalState.prototype.toQueryResult = function (result) {\n var queryResult = this.toQueryResultCache.get(result);\n if (queryResult)\n return queryResult;\n var data = result.data, partial = result.partial, resultWithoutPartial = __rest(result, [\"data\", \"partial\"]);\n this.toQueryResultCache.set(result, queryResult = __assign(__assign(__assign({ data: data }, resultWithoutPartial), this.obsQueryFields), { client: this.client, observable: this.observable, variables: this.observable.variables, called: !this.queryHookOptions.skip, previousData: this.previousData }));\n if (!queryResult.error && isNonEmptyArray(result.errors)) {\n queryResult.error = new ApolloError({ graphQLErrors: result.errors });\n }\n return queryResult;\n };\n InternalState.prototype.unsafeHandlePartialRefetch = function (result) {\n if (result.partial &&\n this.queryHookOptions.partialRefetch &&\n !result.loading &&\n (!result.data || Object.keys(result.data).length === 0) &&\n this.observable.options.fetchPolicy !== 'cache-only') {\n Object.assign(result, {\n loading: true,\n networkStatus: NetworkStatus.refetch,\n });\n this.observable.refetch();\n }\n };\n return InternalState;\n}());\n//# sourceMappingURL=useQuery.js.map","import { __assign } from \"tslib\";\nimport { useCallback, useMemo, useRef } from 'react';\nimport { mergeOptions } from \"../../utilities/index.js\";\nimport { useInternalState } from \"./useQuery.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nvar EAGER_METHODS = [\n 'refetch',\n 'reobserve',\n 'fetchMore',\n 'updateQuery',\n 'startPolling',\n 'subscribeToMore',\n];\nexport function useLazyQuery(query, options) {\n var _a;\n var execOptionsRef = useRef();\n var optionsRef = useRef();\n var queryRef = useRef();\n var merged = execOptionsRef.current ? mergeOptions(options, execOptionsRef.current) : options;\n var document = (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query;\n optionsRef.current = merged;\n queryRef.current = document;\n var internalState = useInternalState(useApolloClient(options && options.client), document);\n var useQueryResult = internalState.useQuery(__assign(__assign({}, merged), { skip: !execOptionsRef.current }));\n var initialFetchPolicy = useQueryResult.observable.options.initialFetchPolicy ||\n internalState.getDefaultFetchPolicy();\n var result = Object.assign(useQueryResult, {\n called: !!execOptionsRef.current,\n });\n var eagerMethods = useMemo(function () {\n var eagerMethods = {};\n var _loop_1 = function (key) {\n var method = result[key];\n eagerMethods[key] = function () {\n if (!execOptionsRef.current) {\n execOptionsRef.current = Object.create(null);\n internalState.forceUpdate();\n }\n return method.apply(this, arguments);\n };\n };\n for (var _i = 0, EAGER_METHODS_1 = EAGER_METHODS; _i < EAGER_METHODS_1.length; _i++) {\n var key = EAGER_METHODS_1[_i];\n _loop_1(key);\n }\n return eagerMethods;\n }, []);\n Object.assign(result, eagerMethods);\n var execute = useCallback(function (executeOptions) {\n execOptionsRef.current = executeOptions ? __assign(__assign({}, executeOptions), { fetchPolicy: executeOptions.fetchPolicy || initialFetchPolicy }) : {\n fetchPolicy: initialFetchPolicy,\n };\n var options = mergeOptions(optionsRef.current, __assign({ query: queryRef.current }, execOptionsRef.current));\n var promise = internalState\n .executeQuery(__assign(__assign({}, options), { skip: false }))\n .then(function (queryResult) { return Object.assign(queryResult, eagerMethods); });\n promise.catch(function () { });\n return promise;\n }, []);\n return [execute, result];\n}\n//# sourceMappingURL=useLazyQuery.js.map","import { __assign } from \"tslib\";\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { mergeOptions, } from \"../../core/index.js\";\nimport { equal } from '@wry/equality';\nimport { DocumentType, verifyDocumentType } from \"../parser/index.js\";\nimport { ApolloError } from \"../../errors/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nexport function useMutation(mutation, options) {\n var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);\n verifyDocumentType(mutation, DocumentType.Mutation);\n var _a = useState({\n called: false,\n loading: false,\n client: client,\n }), result = _a[0], setResult = _a[1];\n var ref = useRef({\n result: result,\n mutationId: 0,\n isMounted: true,\n client: client,\n mutation: mutation,\n options: options,\n });\n {\n Object.assign(ref.current, { client: client, options: options, mutation: mutation });\n }\n var execute = useCallback(function (executeOptions) {\n if (executeOptions === void 0) { executeOptions = {}; }\n var _a = ref.current, options = _a.options, mutation = _a.mutation;\n var baseOptions = __assign(__assign({}, options), { mutation: mutation });\n var client = executeOptions.client || ref.current.client;\n if (!ref.current.result.loading && !baseOptions.ignoreResults && ref.current.isMounted) {\n setResult(ref.current.result = {\n loading: true,\n error: void 0,\n data: void 0,\n called: true,\n client: client,\n });\n }\n var mutationId = ++ref.current.mutationId;\n var clientOptions = mergeOptions(baseOptions, executeOptions);\n return client.mutate(clientOptions).then(function (response) {\n var _a;\n var data = response.data, errors = response.errors;\n var error = errors && errors.length > 0\n ? new ApolloError({ graphQLErrors: errors })\n : void 0;\n if (mutationId === ref.current.mutationId &&\n !clientOptions.ignoreResults) {\n var result_1 = {\n called: true,\n loading: false,\n data: data,\n error: error,\n client: client,\n };\n if (ref.current.isMounted && !equal(ref.current.result, result_1)) {\n setResult(ref.current.result = result_1);\n }\n }\n var onCompleted = executeOptions.onCompleted || ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onCompleted);\n onCompleted === null || onCompleted === void 0 ? void 0 : onCompleted(response.data, clientOptions);\n return response;\n }).catch(function (error) {\n var _a;\n if (mutationId === ref.current.mutationId &&\n ref.current.isMounted) {\n var result_2 = {\n loading: false,\n error: error,\n data: void 0,\n called: true,\n client: client,\n };\n if (!equal(ref.current.result, result_2)) {\n setResult(ref.current.result = result_2);\n }\n }\n var onError = executeOptions.onError || ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError);\n if (onError) {\n onError(error, clientOptions);\n return { data: void 0, errors: error };\n }\n throw error;\n });\n }, []);\n var reset = useCallback(function () {\n if (ref.current.isMounted) {\n setResult({ called: false, loading: false, client: client });\n }\n }, []);\n useEffect(function () {\n ref.current.isMounted = true;\n return function () {\n ref.current.isMounted = false;\n };\n }, []);\n return [execute, __assign({ reset: reset }, result)];\n}\n//# sourceMappingURL=useMutation.js.map","import \"../../utilities/globals/index.js\";\nimport { useState, useRef, useEffect } from 'react';\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport { equal } from '@wry/equality';\nimport { DocumentType, verifyDocumentType } from \"../parser/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nexport function useSubscription(subscription, options) {\n var hasIssuedDeprecationWarningRef = useRef(false);\n var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);\n verifyDocumentType(subscription, DocumentType.Subscription);\n var _a = useState({\n loading: !(options === null || options === void 0 ? void 0 : options.skip),\n error: void 0,\n data: void 0,\n variables: options === null || options === void 0 ? void 0 : options.variables,\n }), result = _a[0], setResult = _a[1];\n if (!hasIssuedDeprecationWarningRef.current) {\n hasIssuedDeprecationWarningRef.current = true;\n if (options === null || options === void 0 ? void 0 : options.onSubscriptionData) {\n __DEV__ && invariant.warn(options.onData\n ? \"'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used.\"\n : \"'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead.\");\n }\n if (options === null || options === void 0 ? void 0 : options.onSubscriptionComplete) {\n __DEV__ && invariant.warn(options.onComplete\n ? \"'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used.\"\n : \"'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead.\");\n }\n }\n var _b = useState(function () {\n if (options === null || options === void 0 ? void 0 : options.skip) {\n return null;\n }\n return client.subscribe({\n query: subscription,\n variables: options === null || options === void 0 ? void 0 : options.variables,\n fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,\n context: options === null || options === void 0 ? void 0 : options.context,\n });\n }), observable = _b[0], setObservable = _b[1];\n var canResetObservableRef = useRef(false);\n useEffect(function () {\n return function () {\n canResetObservableRef.current = true;\n };\n }, []);\n var ref = useRef({ client: client, subscription: subscription, options: options });\n useEffect(function () {\n var _a, _b, _c, _d;\n var shouldResubscribe = options === null || options === void 0 ? void 0 : options.shouldResubscribe;\n if (typeof shouldResubscribe === 'function') {\n shouldResubscribe = !!shouldResubscribe(options);\n }\n if (options === null || options === void 0 ? void 0 : options.skip) {\n if (!(options === null || options === void 0 ? void 0 : options.skip) !== !((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.skip) || canResetObservableRef.current) {\n setResult({\n loading: false,\n data: void 0,\n error: void 0,\n variables: options === null || options === void 0 ? void 0 : options.variables,\n });\n setObservable(null);\n canResetObservableRef.current = false;\n }\n }\n else if ((shouldResubscribe !== false &&\n (client !== ref.current.client ||\n subscription !== ref.current.subscription ||\n (options === null || options === void 0 ? void 0 : options.fetchPolicy) !== ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.fetchPolicy) ||\n !(options === null || options === void 0 ? void 0 : options.skip) !== !((_c = ref.current.options) === null || _c === void 0 ? void 0 : _c.skip) ||\n !equal(options === null || options === void 0 ? void 0 : options.variables, (_d = ref.current.options) === null || _d === void 0 ? void 0 : _d.variables))) ||\n canResetObservableRef.current) {\n setResult({\n loading: true,\n data: void 0,\n error: void 0,\n variables: options === null || options === void 0 ? void 0 : options.variables,\n });\n setObservable(client.subscribe({\n query: subscription,\n variables: options === null || options === void 0 ? void 0 : options.variables,\n fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,\n context: options === null || options === void 0 ? void 0 : options.context,\n }));\n canResetObservableRef.current = false;\n }\n Object.assign(ref.current, { client: client, subscription: subscription, options: options });\n }, [client, subscription, options, canResetObservableRef.current]);\n useEffect(function () {\n if (!observable) {\n return;\n }\n var subscriptionStopped = false;\n var subscription = observable.subscribe({\n next: function (fetchResult) {\n var _a, _b;\n if (subscriptionStopped) {\n return;\n }\n var result = {\n loading: false,\n data: fetchResult.data,\n error: void 0,\n variables: options === null || options === void 0 ? void 0 : options.variables,\n };\n setResult(result);\n if ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onData) {\n ref.current.options.onData({\n client: client,\n data: result\n });\n }\n else if ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onSubscriptionData) {\n ref.current.options.onSubscriptionData({\n client: client,\n subscriptionData: result\n });\n }\n },\n error: function (error) {\n var _a, _b;\n if (!subscriptionStopped) {\n setResult({\n loading: false,\n data: void 0,\n error: error,\n variables: options === null || options === void 0 ? void 0 : options.variables,\n });\n (_b = (_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);\n }\n ;\n },\n complete: function () {\n var _a, _b;\n if (!subscriptionStopped) {\n if ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onComplete) {\n ref.current.options.onComplete();\n }\n else if ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onSubscriptionComplete) {\n ref.current.options.onSubscriptionComplete();\n }\n }\n },\n });\n return function () {\n subscriptionStopped = true;\n setTimeout(function () {\n subscription.unsubscribe();\n });\n };\n }, [observable]);\n return result;\n}\n//# sourceMappingURL=useSubscription.js.map","import { useEffect, useState } from 'react';\nexport function useReactiveVar(rv) {\n var value = rv();\n var setValue = useState(value)[1];\n useEffect(function () {\n var probablySameValue = rv();\n if (value !== probablySameValue) {\n setValue(probablySameValue);\n }\n else {\n return rv.onNextChange(setValue);\n }\n }, [value]);\n return value;\n}\n//# sourceMappingURL=useReactiveVar.js.map","import { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nexport type Maybe = T | null;\nexport type InputMaybe = Maybe;\nexport type Exact = { [K in keyof T]: T[K] };\nexport type MakeOptional = Omit & { [SubKey in K]?: Maybe };\nexport type MakeMaybe = Omit & { [SubKey in K]: Maybe };\nconst defaultOptions = {} as const;\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: string;\n String: string;\n Boolean: boolean;\n Int: number;\n Float: number;\n DateTime: any;\n JSON: any;\n};\n\nexport type Ad = {\n __typename?: 'Ad';\n adManagerAccount: AdManagerAccount;\n adManagerAccountId: Scalars['ID'];\n adPlatformAccountId: Scalars['ID'];\n adset: Adset;\n adsetId?: Maybe;\n campaign: Campaign;\n campaignId?: Maybe;\n copy?: Maybe;\n createdAt: Scalars['DateTime'];\n effectiveStatus: AdEffectiveStatus;\n headline?: Maybe;\n id: Scalars['ID'];\n mediaUrl?: Maybe;\n name: Scalars['String'];\n orders?: Maybe;\n ordersValue?: Maybe;\n productLink?: Maybe;\n sourceAdId: Scalars['String'];\n sourceAdManagerAccountId: Scalars['String'];\n sourceAdsetId: Scalars['String'];\n sourceCampaignId: Scalars['String'];\n sourceCreatedAt?: Maybe;\n sourceOrders?: Maybe;\n sourceOrdersValue?: Maybe;\n spend?: Maybe;\n status: AdStatus;\n store: Store;\n storeId: Scalars['ID'];\n updatedAt: Scalars['DateTime'];\n};\n\nexport type AdByIdQueryInput = {\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n};\n\nexport enum AdEffectiveStatus {\n Active = 'ACTIVE',\n AdsetPaused = 'ADSET_PAUSED',\n Archived = 'ARCHIVED',\n CampaignPaused = 'CAMPAIGN_PAUSED',\n Deleted = 'DELETED',\n Disapproved = 'DISAPPROVED',\n InProcess = 'IN_PROCESS',\n Paused = 'PAUSED',\n PendingBillingInfo = 'PENDING_BILLING_INFO',\n PendingReview = 'PENDING_REVIEW',\n Preapproved = 'PREAPPROVED',\n WithIssues = 'WITH_ISSUES'\n}\n\nexport type AdList = {\n __typename?: 'AdList';\n ads?: Maybe>;\n aggregates: AggregateTotals;\n total: Scalars['Int'];\n totals: Totals;\n};\n\nexport type AdManagerAccount = {\n __typename?: 'AdManagerAccount';\n accountStatus: Scalars['String'];\n adPlatformAccount: AdPlatformAccount;\n adPlatformAccountId: Scalars['ID'];\n ads?: Maybe>;\n adsets?: Maybe>;\n amountSpent: Scalars['Float'];\n campaigns?: Maybe>;\n createdAt: Scalars['DateTime'];\n entityDeltaAt?: Maybe;\n id: Scalars['ID'];\n metricsDeltaAt?: Maybe;\n name: Scalars['String'];\n sourceAdManagerAccountId: Scalars['String'];\n sourceCreatedAt?: Maybe;\n store: Store;\n storeId: Scalars['ID'];\n timezoneName?: Maybe;\n timezoneOffsetHoursUtc?: Maybe;\n updatedAt: Scalars['DateTime'];\n};\n\nexport type AdPlatformAccount = {\n __typename?: 'AdPlatformAccount';\n adManagerAccounts?: Maybe>>;\n createdAt: Scalars['DateTime'];\n downloadedAt?: Maybe;\n id: Scalars['ID'];\n name: Platform;\n store?: Maybe;\n storeId: Scalars['ID'];\n updatedAt: Scalars['DateTime'];\n};\n\nexport type AdPlatformAccountDoesNotExist = {\n __typename?: 'AdPlatformAccountDoesNotExist';\n error?: Maybe;\n};\n\nexport enum AdStatus {\n Active = 'ACTIVE',\n Archived = 'ARCHIVED',\n Deleted = 'DELETED',\n Paused = 'PAUSED'\n}\n\nexport type AddShopifyStoreInput = {\n code?: InputMaybe;\n foxtraxStoreId?: InputMaybe;\n hmac: Scalars['String'];\n host: Scalars['String'];\n shopifyStoreUrl: Scalars['String'];\n timestamp: Scalars['String'];\n};\n\nexport type AddShopifyStoreResult = Store | UnableToAddShopifyStore;\n\nexport type AddToCartEventInput = {\n sourceProductId: Scalars['String'];\n};\n\nexport type AdsByAdManagerAccountIdsQueryInput = {\n adsetSearch?: InputMaybe>>;\n campaignSearch?: InputMaybe>>;\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n filters?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n limit?: InputMaybe;\n offset?: InputMaybe;\n search?: InputMaybe>>;\n selectedAdsetIds?: InputMaybe>;\n selectedCampaignIds?: InputMaybe>;\n sort?: InputMaybe>;\n};\n\nexport type AdsByAdsetIdQueryInput = {\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n filters?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n limit?: InputMaybe;\n offset?: InputMaybe;\n search?: InputMaybe>>;\n sort?: InputMaybe>;\n};\n\nexport type Adset = {\n __typename?: 'Adset';\n adManagerAccount: AdManagerAccount;\n adManagerAccountId: Scalars['ID'];\n adPlatformAccountId: Scalars['ID'];\n ads?: Maybe;\n campaign: Campaign;\n campaignId?: Maybe;\n createdAt: Scalars['DateTime'];\n dailyBudget?: Maybe;\n effectiveStatus: AdsetEffectiveStatus;\n id: Scalars['ID'];\n lifetimeBudget?: Maybe;\n name: Scalars['String'];\n orders?: Maybe;\n ordersValue?: Maybe;\n sourceAdManagerAccountId: Scalars['String'];\n sourceAdsetId: Scalars['String'];\n sourceCampaignId: Scalars['String'];\n sourceCreatedAt?: Maybe;\n sourceOrders?: Maybe;\n sourceOrdersValue?: Maybe;\n spend?: Maybe;\n status: AdsetStatus;\n store: Store;\n storeId: Scalars['ID'];\n updatedAt: Scalars['DateTime'];\n};\n\n\nexport type AdsetAdsArgs = {\n input?: InputMaybe;\n};\n\nexport type AdsetByIdQueryInput = {\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n};\n\nexport enum AdsetEffectiveStatus {\n Active = 'ACTIVE',\n Archived = 'ARCHIVED',\n CampaignPaused = 'CAMPAIGN_PAUSED',\n Deleted = 'DELETED',\n InProcess = 'IN_PROCESS',\n Paused = 'PAUSED',\n WithIssues = 'WITH_ISSUES'\n}\n\nexport type AdsetList = {\n __typename?: 'AdsetList';\n adsets?: Maybe>;\n aggregates: AggregateTotals;\n total: Scalars['Int'];\n totals: Totals;\n};\n\nexport enum AdsetStatus {\n Active = 'ACTIVE',\n Archived = 'ARCHIVED',\n Deleted = 'DELETED',\n Paused = 'PAUSED'\n}\n\nexport type AdsetsByAdManagerAccountIdsQueryInput = {\n campaignSearch?: InputMaybe>>;\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n filters?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n limit?: InputMaybe;\n offset?: InputMaybe;\n search?: InputMaybe>>;\n selectedCampaignIds?: InputMaybe>;\n sort?: InputMaybe>;\n};\n\nexport type AdsetsByCampaignIdQueryInput = {\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n filters?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n limit?: InputMaybe;\n offset?: InputMaybe;\n search?: InputMaybe>>;\n sort?: InputMaybe>;\n};\n\nexport type AggregateTotals = {\n __typename?: 'AggregateTotals';\n orders?: Maybe;\n ordersValue?: Maybe;\n sourceOrders?: Maybe;\n sourceOrdersValue?: Maybe;\n spend?: Maybe;\n};\n\nexport enum Attribution {\n OneDayFirstClick = 'ONE_DAY_FIRST_CLICK',\n OneDayLastClick = 'ONE_DAY_LAST_CLICK',\n OneDayView = 'ONE_DAY_VIEW',\n SevenDayClickOrOneDayView = 'SEVEN_DAY_CLICK_OR_ONE_DAY_VIEW',\n SevenDayFirstClick = 'SEVEN_DAY_FIRST_CLICK',\n SevenDayLastClick = 'SEVEN_DAY_LAST_CLICK',\n SevenDayView = 'SEVEN_DAY_VIEW'\n}\n\nexport type BillingPortal = {\n __typename?: 'BillingPortal';\n sessionUrl: Scalars['String'];\n};\n\nexport type Campaign = {\n __typename?: 'Campaign';\n adManagerAccount: AdManagerAccount;\n adManagerAccountId: Scalars['ID'];\n adPlatformAccountId: Scalars['ID'];\n adsets?: Maybe;\n createdAt: Scalars['DateTime'];\n dailyBudget?: Maybe;\n effectiveStatus: CampaignEffectiveStatus;\n id: Scalars['ID'];\n lifetimeBudget?: Maybe;\n name: Scalars['String'];\n orders?: Maybe;\n ordersValue?: Maybe;\n sourceAdManagerAccountId: Scalars['String'];\n sourceCampaignId: Scalars['String'];\n sourceCreatedAt?: Maybe;\n sourceOrders?: Maybe;\n sourceOrdersValue?: Maybe;\n spend?: Maybe;\n status: CampaignStatus;\n store: Store;\n storeId: Scalars['ID'];\n updatedAt: Scalars['DateTime'];\n};\n\n\nexport type CampaignAdsetsArgs = {\n input?: InputMaybe;\n};\n\nexport type CampaignByIdQueryInput = {\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n};\n\nexport enum CampaignEffectiveStatus {\n Active = 'ACTIVE',\n AdsetPaused = 'ADSET_PAUSED',\n Archived = 'ARCHIVED',\n CampaignPaused = 'CAMPAIGN_PAUSED',\n Deleted = 'DELETED',\n Disapproved = 'DISAPPROVED',\n InProcess = 'IN_PROCESS',\n Paused = 'PAUSED',\n PendingBillingInfo = 'PENDING_BILLING_INFO',\n PendingReview = 'PENDING_REVIEW',\n Preapproved = 'PREAPPROVED',\n WithIssues = 'WITH_ISSUES'\n}\n\nexport type CampaignList = {\n __typename?: 'CampaignList';\n aggregates: AggregateTotals;\n campaigns?: Maybe>;\n total: Scalars['Int'];\n totals: Totals;\n};\n\nexport enum CampaignStatus {\n Active = 'ACTIVE',\n Archived = 'ARCHIVED',\n Deleted = 'DELETED',\n Paused = 'PAUSED'\n}\n\nexport type CampaignsByAdManagerAccountIdsQueryInput = {\n dateRange?: InputMaybe;\n facebookAttribution?: InputMaybe;\n filters?: InputMaybe;\n foxTraxAttribution?: InputMaybe;\n limit?: InputMaybe;\n offset?: InputMaybe;\n search?: InputMaybe>>;\n sort?: InputMaybe>;\n};\n\nexport type CheckoutSession = {\n __typename?: 'CheckoutSession';\n sessionUrl: Scalars['String'];\n};\n\nexport type ConnectShopifyToFoxtraxInput = {\n shopifyStoreUrl: Scalars['String'];\n};\n\nexport type CreateAdPlatformAccountInput = {\n name: Platform;\n storeId: Scalars['ID'];\n};\n\nexport type CreateAdPlatformAccountResult = AdPlatformAccount | UnableToCreateAdPlatformAccount;\n\nexport type CreateBillingPortalInput = {\n returnUrl: Scalars['String'];\n};\n\nexport type CreateBillingPortalResult = BillingPortal | Error;\n\nexport type CreateCheckoutSessionInput = {\n affiliateLinkId?: InputMaybe;\n cancelUrl: Scalars['String'];\n clientIpAddress: Scalars['String'];\n clientUserAgent: Scalars['String'];\n email: Scalars['String'];\n fbclid?: InputMaybe;\n isYearly: Scalars['Boolean'];\n successUrl: Scalars['String'];\n};\n\nexport type CreateCheckoutSessionResult = CheckoutSession | SubscriptionAlreadyCreated | UnableToCreateCheckoutSession;\n\nexport type CreateOrganizationInput = {\n adSpend?: InputMaybe;\n country?: InputMaybe;\n name: Scalars['String'];\n referralSource?: InputMaybe;\n};\n\nexport type CreateOrganizationResult = Organization | UnableToCreateOrganization;\n\nexport type CreatePixelEventInput = {\n addToCartEvent?: InputMaybe;\n /** The Anonymous ID assigned to the browser (user) */\n anonymousId: Scalars['String'];\n createdAt?: InputMaybe;\n device?: InputMaybe;\n ipAddress?: InputMaybe;\n order?: InputMaybe;\n /** The URL of the page where the pixel event was fired */\n url?: InputMaybe;\n};\n\nexport type CreatePixelEventResult = {\n __typename?: 'CreatePixelEventResult';\n code: Scalars['Int'];\n};\n\nexport type CreateStoreInput = {\n name: Scalars['String'];\n organizationId?: InputMaybe;\n};\n\nexport type CreateStoreResult = Store | UnableToCreateStore;\n\nexport type CreateUserInput = {\n countryCode?: InputMaybe;\n email: Scalars['String'];\n firstName?: InputMaybe;\n lastName?: InputMaybe;\n password: Scalars['String'];\n phone?: InputMaybe;\n role: Role;\n shouldCreateStoreAndOrganization?: InputMaybe;\n timezone?: InputMaybe;\n};\n\nexport type CreateUserResult = User | UserAlreadyExists;\n\nexport type DateRange = {\n endDate?: InputMaybe;\n startDate?: InputMaybe;\n};\n\nexport type DeleteAdPlatformAccountResult = AdPlatformAccount | UnableToDeleteAdPlatformAccount;\n\nexport type DeleteOrganizationResult = Organization | UnableToDeleteOrganization;\n\nexport type DeleteStoreResult = Store | UnableToDeleteStore;\n\nexport type DeleteUserResult = User | UserNotFound;\n\nexport type DeviceInput = {\n deviceFingerPrint: Scalars['String'];\n isMobile: Scalars['Boolean'];\n platform: Scalars['String'];\n};\n\nexport type DisconnectAdPlatform = {\n __typename?: 'DisconnectAdPlatform';\n disconnected: Scalars['Boolean'];\n};\n\nexport type DisconnectAdPlatformResult = AdPlatformAccountDoesNotExist | DisconnectAdPlatform;\n\nexport type Error = {\n __typename?: 'Error';\n error: Scalars['String'];\n};\n\nexport enum FacebookAttribution {\n OneDayFirstClick = 'ONE_DAY_FIRST_CLICK',\n OneDayLastClick = 'ONE_DAY_LAST_CLICK',\n SevenDayClickOrOneDayView = 'SEVEN_DAY_CLICK_OR_ONE_DAY_VIEW',\n SevenDayFirstClick = 'SEVEN_DAY_FIRST_CLICK',\n SevenDayLastClick = 'SEVEN_DAY_LAST_CLICK'\n}\n\nexport enum FoxTraxAttribution {\n OneDayFirstClick = 'ONE_DAY_FIRST_CLICK',\n OneDayLastClick = 'ONE_DAY_LAST_CLICK',\n SevenDayFirstClick = 'SEVEN_DAY_FIRST_CLICK',\n SevenDayLastClick = 'SEVEN_DAY_LAST_CLICK'\n}\n\nexport type GenerateFacebookLink = {\n __typename?: 'GenerateFacebookLink';\n connected: Scalars['Boolean'];\n oauthLink: Scalars['String'];\n};\n\nexport type InvalidCredentials = {\n __typename?: 'InvalidCredentials';\n error: Scalars['String'];\n};\n\nexport type LoadingProgress = {\n __typename?: 'LoadingProgress';\n entities?: Maybe;\n id?: Maybe;\n metrics?: Maybe;\n};\n\nexport type LoadingProgressConnected = {\n __typename?: 'LoadingProgressConnected';\n connected?: Maybe;\n entities?: Maybe;\n id?: Maybe;\n metrics?: Maybe;\n};\n\nexport type LoginResult = InvalidCredentials | User;\n\nexport type LogoutResult = {\n __typename?: 'LogoutResult';\n message: Scalars['String'];\n};\n\nexport type Mutation = {\n __typename?: 'Mutation';\n connectShopifyToFoxtrax?: Maybe;\n createAdPlatformAccount: CreateAdPlatformAccountResult;\n createBillingPortalByStoreId?: Maybe;\n createCheckoutSessionByStoreId?: Maybe;\n createOrganization?: Maybe;\n createPixelEventByStoreId: CreatePixelEventResult;\n createShopifyToken?: Maybe;\n createStore?: Maybe;\n createUser: CreateUserResult;\n deleteAdPlatformAccountById: DeleteAdPlatformAccountResult;\n deleteOrganizationById?: Maybe;\n deleteStoreById?: Maybe;\n deleteUserById: DeleteUserResult;\n disconnectAdPlatformByStoreId: DisconnectAdPlatformResult;\n generateFacebookLinkByStoreId: GenerateFacebookLink;\n login: LoginResult;\n logout: LogoutResult;\n resetUserPasswordByContextUserId: ResetPasswordResult;\n retryDownloadByAdPlatformAccountId: RetryDownloadResult;\n root?: Maybe;\n sendCodeByEmail: SendCodeResult;\n updateAdById?: Maybe;\n updateAdsetById?: Maybe;\n updateCampaignById?: Maybe;\n updateOrganizationById?: Maybe;\n updateStoreById?: Maybe;\n updateUserById: UpdateUserResult;\n verifyCode: VerifyCodeResult;\n};\n\n\nexport type MutationConnectShopifyToFoxtraxArgs = {\n id: Scalars['ID'];\n input: ConnectShopifyToFoxtraxInput;\n};\n\n\nexport type MutationCreateAdPlatformAccountArgs = {\n input: CreateAdPlatformAccountInput;\n};\n\n\nexport type MutationCreateBillingPortalByStoreIdArgs = {\n id: Scalars['ID'];\n input: CreateBillingPortalInput;\n};\n\n\nexport type MutationCreateCheckoutSessionByStoreIdArgs = {\n id: Scalars['ID'];\n input: CreateCheckoutSessionInput;\n};\n\n\nexport type MutationCreateOrganizationArgs = {\n input: CreateOrganizationInput;\n};\n\n\nexport type MutationCreatePixelEventByStoreIdArgs = {\n id: Scalars['String'];\n input?: InputMaybe;\n};\n\n\nexport type MutationCreateShopifyTokenArgs = {\n input: AddShopifyStoreInput;\n};\n\n\nexport type MutationCreateStoreArgs = {\n input: CreateStoreInput;\n};\n\n\nexport type MutationCreateUserArgs = {\n input: CreateUserInput;\n};\n\n\nexport type MutationDeleteAdPlatformAccountByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type MutationDeleteOrganizationByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type MutationDeleteStoreByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type MutationDeleteUserByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type MutationDisconnectAdPlatformByStoreIdArgs = {\n id: Scalars['ID'];\n platform: Platform;\n};\n\n\nexport type MutationGenerateFacebookLinkByStoreIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type MutationLoginArgs = {\n email: Scalars['String'];\n password: Scalars['String'];\n};\n\n\nexport type MutationResetUserPasswordByContextUserIdArgs = {\n password: Scalars['String'];\n};\n\n\nexport type MutationRetryDownloadByAdPlatformAccountIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type MutationSendCodeByEmailArgs = {\n channel: VerifyChannel;\n email: Scalars['String'];\n};\n\n\nexport type MutationUpdateAdByIdArgs = {\n id: Scalars['ID'];\n input: UpdateAdInput;\n};\n\n\nexport type MutationUpdateAdsetByIdArgs = {\n id: Scalars['ID'];\n input: UpdateAdsetInput;\n};\n\n\nexport type MutationUpdateCampaignByIdArgs = {\n id: Scalars['ID'];\n input: UpdateCampaignInput;\n};\n\n\nexport type MutationUpdateOrganizationByIdArgs = {\n id: Scalars['ID'];\n input: UpdateOrganizationInput;\n};\n\n\nexport type MutationUpdateStoreByIdArgs = {\n id: Scalars['ID'];\n input: UpdateStoreInput;\n};\n\n\nexport type MutationUpdateUserByIdArgs = {\n id: Scalars['ID'];\n user: UpdateUserInput;\n};\n\n\nexport type MutationVerifyCodeArgs = {\n code: Scalars['String'];\n};\n\nexport type OrderInput = {\n currency?: InputMaybe;\n phoneNumber?: InputMaybe;\n sourceOrderId: Scalars['String'];\n totalPrice?: InputMaybe;\n};\n\nexport type OrderMetrics = {\n __typename?: 'OrderMetrics';\n attributed: Scalars['Int'];\n facebook: Scalars['Int'];\n organic: Scalars['Int'];\n total: Scalars['Int'];\n};\n\nexport type Organization = {\n __typename?: 'Organization';\n adSpend?: Maybe;\n country?: Maybe;\n createdAt: Scalars['DateTime'];\n id: Scalars['ID'];\n name: Scalars['String'];\n stores?: Maybe>>;\n subscriptionPlans?: Maybe>>;\n updatedAt: Scalars['DateTime'];\n users?: Maybe>>;\n};\n\nexport type PixelConfigurationStatus = {\n __typename?: 'PixelConfigurationStatus';\n connected: Scalars['Boolean'];\n lastUpdatedAt?: Maybe;\n};\n\nexport type PixelConfigurationStatusResult = Error | PixelConfigurationStatus;\n\nexport type PixelEvent = {\n __typename?: 'PixelEvent';\n adClickId?: Maybe;\n addToCartEventId?: Maybe;\n anonymousIdentityId: Scalars['String'];\n createdAt: Scalars['DateTime'];\n deviceId?: Maybe;\n id: Scalars['ID'];\n ipAddressId: Scalars['String'];\n orderId?: Maybe;\n raw?: Maybe;\n storeId: Scalars['String'];\n updatedAt: Scalars['DateTime'];\n};\n\nexport type PixelEventByIdResult = Error | PixelEvent;\n\nexport enum Platform {\n Facebook = 'FACEBOOK',\n Google = 'GOOGLE',\n Instagram = 'INSTAGRAM'\n}\n\nexport type Query = {\n __typename?: 'Query';\n adById?: Maybe;\n adManagerAccountById?: Maybe;\n adManagerAccountsByPlatformId?: Maybe>;\n adManagerAccountsByStoreId?: Maybe>;\n adPlatformAccountById?: Maybe;\n adPlatformAccountsByStoreId?: Maybe>;\n adsByAdManagerAccountIds?: Maybe;\n adsByAdsetId?: Maybe;\n adsetById?: Maybe;\n adsetsByAdManagerAccountIds?: Maybe;\n adsetsByCampaignId?: Maybe;\n allUsers: Array;\n campaignById?: Maybe;\n campaignsByAdManagerAccountIds?: Maybe;\n downloadProgressByStoreId?: Maybe;\n organizationById?: Maybe;\n organizations?: Maybe>>;\n pixelConfigurationStatusByStoreId: PixelConfigurationStatusResult;\n pixelEventById: PixelEventByIdResult;\n root?: Maybe;\n shopifyAuthUrl?: Maybe;\n shopifyInstallUrl?: Maybe;\n storeById?: Maybe;\n stores?: Maybe>>;\n storesByOrganizationId?: Maybe>>;\n subscriptionPlanByStoreId?: Maybe;\n subscriptionPlansByOrganizationId?: Maybe;\n userById?: Maybe;\n userStatusByStoreId: UserStatus;\n usersByOrganizationId?: Maybe>;\n viewer?: Maybe;\n};\n\n\nexport type QueryAdByIdArgs = {\n id: Scalars['ID'];\n input?: InputMaybe;\n};\n\n\nexport type QueryAdManagerAccountByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryAdManagerAccountsByPlatformIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryAdManagerAccountsByStoreIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryAdPlatformAccountByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryAdPlatformAccountsByStoreIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryAdsByAdManagerAccountIdsArgs = {\n ids: Array;\n input?: InputMaybe;\n};\n\n\nexport type QueryAdsByAdsetIdArgs = {\n id: Scalars['ID'];\n input?: InputMaybe;\n};\n\n\nexport type QueryAdsetByIdArgs = {\n id: Scalars['ID'];\n input?: InputMaybe;\n};\n\n\nexport type QueryAdsetsByAdManagerAccountIdsArgs = {\n ids: Array;\n input?: InputMaybe;\n};\n\n\nexport type QueryAdsetsByCampaignIdArgs = {\n id: Scalars['ID'];\n input?: InputMaybe;\n};\n\n\nexport type QueryCampaignByIdArgs = {\n id: Scalars['ID'];\n input?: InputMaybe;\n};\n\n\nexport type QueryCampaignsByAdManagerAccountIdsArgs = {\n ids: Array;\n input?: InputMaybe;\n};\n\n\nexport type QueryDownloadProgressByStoreIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryOrganizationByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryPixelConfigurationStatusByStoreIdArgs = {\n id?: InputMaybe;\n};\n\n\nexport type QueryPixelEventByIdArgs = {\n id: Scalars['String'];\n};\n\n\nexport type QueryShopifyAuthUrlArgs = {\n input: ShopifyAuthUrlInput;\n};\n\n\nexport type QueryStoreByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryStoresByOrganizationIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QuerySubscriptionPlanByStoreIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QuerySubscriptionPlansByOrganizationIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryUserByIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryUserStatusByStoreIdArgs = {\n id: Scalars['ID'];\n};\n\n\nexport type QueryUsersByOrganizationIdArgs = {\n id: Scalars['ID'];\n};\n\nexport type ResetPasswordResult = UnableToResetPassword | User;\n\nexport type RetryDownloadResult = {\n __typename?: 'RetryDownloadResult';\n error?: Maybe;\n success: Scalars['Boolean'];\n};\n\nexport type RevenueMetrics = {\n __typename?: 'RevenueMetrics';\n attributed: Scalars['Float'];\n facebook: Scalars['Float'];\n organic: Scalars['Float'];\n total: Scalars['Float'];\n};\n\nexport enum Role {\n Owner = 'owner',\n SuperAdmin = 'superAdmin'\n}\n\nexport type SendCode = {\n email: Scalars['String'];\n};\n\nexport type SendCodeResult = SendCodeSuccess | UnableToSendCode | UserNotFound;\n\nexport type SendCodeSuccess = {\n __typename?: 'SendCodeSuccess';\n expiresAt: Scalars['String'];\n message: Scalars['String'];\n sentAt: Scalars['String'];\n status: VerifyStatus;\n};\n\nexport type ShopifyAuthUrlInput = {\n hostname: Scalars['String'];\n};\n\nexport type ShopifyConnectedToFoxtrax = {\n __typename?: 'ShopifyConnectedToFoxtrax';\n success: Scalars['Boolean'];\n};\n\nexport type ShopifyTokenResult = {\n __typename?: 'ShopifyTokenResult';\n connectedToStore: Scalars['Boolean'];\n success: Scalars['Boolean'];\n};\n\nexport enum SortDirection {\n Asc = 'ASC',\n Desc = 'DESC'\n}\n\nexport type SortInput = {\n column: Scalars['String'];\n order: SortDirection;\n};\n\nexport type Store = {\n __typename?: 'Store';\n adPlatformAccounts?: Maybe>;\n createdAt: Scalars['DateTime'];\n hostname?: Maybe;\n id: Scalars['ID'];\n name: Scalars['String'];\n organization: Organization;\n organizationId: Scalars['String'];\n shopifyConnected?: Maybe;\n sourceStoreId?: Maybe;\n subscriptionId?: Maybe;\n subscriptionPlan?: Maybe;\n updatedAt: Scalars['DateTime'];\n};\n\nexport type StoreShopifyTokenInput = {\n accessToken: Scalars['String'];\n storeUrl: Scalars['String'];\n};\n\nexport type StoreShopifyTokenResult = ShopifyTokenResult | UnableToAddShopifyToken;\n\nexport type Subscription = {\n __typename?: 'Subscription';\n progress?: Maybe;\n root?: Maybe;\n};\n\n\nexport type SubscriptionProgressArgs = {\n id: Scalars['ID'];\n};\n\nexport type SubscriptionAlreadyCreated = {\n __typename?: 'SubscriptionAlreadyCreated';\n message: Scalars['String'];\n subscriptionPlan: SubscriptionPlan;\n};\n\nexport type SubscriptionPlan = {\n __typename?: 'SubscriptionPlan';\n canceledAt?: Maybe;\n createdAt: Scalars['DateTime'];\n currentPeriodEnd: Scalars['DateTime'];\n currentPeriodStart: Scalars['DateTime'];\n id: Scalars['ID'];\n isYearly?: Maybe;\n organization: Organization;\n organizationId: Scalars['String'];\n planId: Scalars['String'];\n status: SubscriptionPlanStatus;\n store: Store;\n storeId: Scalars['String'];\n subscriptionId: Scalars['String'];\n updatedAt: Scalars['DateTime'];\n};\n\nexport type SubscriptionPlanResult = Error | SubscriptionPlan;\n\nexport enum SubscriptionPlanStatus {\n Active = 'ACTIVE',\n Canceled = 'CANCELED',\n Incomplete = 'INCOMPLETE',\n IncompleteExpired = 'INCOMPLETE_EXPIRED',\n PastDue = 'PAST_DUE',\n Paused = 'PAUSED',\n Trialing = 'TRIALING',\n Unpaid = 'UNPAID'\n}\n\nexport type SubscriptionPlans = {\n __typename?: 'SubscriptionPlans';\n subscriptionPlans: Array;\n};\n\nexport type SubscriptionPlansResult = Error | SubscriptionPlans;\n\nexport type Totals = {\n __typename?: 'Totals';\n dailyBudget?: Maybe;\n orders: OrderMetrics;\n revenue: RevenueMetrics;\n spend: Scalars['Float'];\n};\n\nexport type UnableToAddShopifyStore = {\n __typename?: 'UnableToAddShopifyStore';\n error: Scalars['String'];\n};\n\nexport type UnableToAddShopifyToken = {\n __typename?: 'UnableToAddShopifyToken';\n error: Scalars['String'];\n};\n\nexport type UnableToCreateAdPlatformAccount = {\n __typename?: 'UnableToCreateAdPlatformAccount';\n error: Scalars['String'];\n};\n\nexport type UnableToCreateCheckoutSession = {\n __typename?: 'UnableToCreateCheckoutSession';\n error: Scalars['String'];\n};\n\nexport type UnableToCreateOrganization = {\n __typename?: 'UnableToCreateOrganization';\n error: Scalars['String'];\n};\n\nexport type UnableToCreateStore = {\n __typename?: 'UnableToCreateStore';\n error: Scalars['String'];\n};\n\nexport type UnableToDeleteAdPlatformAccount = {\n __typename?: 'UnableToDeleteAdPlatformAccount';\n error: Scalars['String'];\n};\n\nexport type UnableToDeleteOrganization = {\n __typename?: 'UnableToDeleteOrganization';\n error: Scalars['String'];\n};\n\nexport type UnableToDeleteStore = {\n __typename?: 'UnableToDeleteStore';\n error: Scalars['String'];\n};\n\nexport type UnableToResetPassword = {\n __typename?: 'UnableToResetPassword';\n error: Scalars['String'];\n};\n\nexport type UnableToSendCode = {\n __typename?: 'UnableToSendCode';\n error: Scalars['String'];\n status: VerifyStatus;\n};\n\nexport type UnableToStoreShopifyToken = {\n __typename?: 'UnableToStoreShopifyToken';\n error: Scalars['String'];\n};\n\nexport type UnableToUpdateAd = {\n __typename?: 'UnableToUpdateAd';\n error: Scalars['String'];\n};\n\nexport type UnableToUpdateAdset = {\n __typename?: 'UnableToUpdateAdset';\n error: Scalars['String'];\n};\n\nexport type UnableToUpdateCampaign = {\n __typename?: 'UnableToUpdateCampaign';\n error: Scalars['String'];\n};\n\nexport type UnableToUpdateOrganization = {\n __typename?: 'UnableToUpdateOrganization';\n error: Scalars['String'];\n};\n\nexport type UnableToUpdateStore = {\n __typename?: 'UnableToUpdateStore';\n error: Scalars['String'];\n};\n\nexport type UnableToVerifyCode = {\n __typename?: 'UnableToVerifyCode';\n error: Scalars['String'];\n status: VerifyStatus;\n};\n\nexport type UpdateAdInput = {\n status?: InputMaybe;\n};\n\nexport type UpdateAdResult = Ad | UnableToUpdateAd;\n\nexport type UpdateAdsetInput = {\n status?: InputMaybe;\n};\n\nexport type UpdateAdsetResult = Adset | UnableToUpdateAdset;\n\nexport type UpdateCampaignInput = {\n status?: InputMaybe;\n};\n\nexport type UpdateCampaignResult = Campaign | UnableToUpdateCampaign;\n\nexport type UpdateOrganizationInput = {\n adSpend?: InputMaybe;\n country?: InputMaybe;\n name?: InputMaybe;\n referralSource?: InputMaybe;\n};\n\nexport type UpdateOrganizationResult = Organization | UnableToUpdateOrganization;\n\nexport type UpdateStoreInput = {\n name?: InputMaybe;\n organizationId?: InputMaybe;\n};\n\nexport type UpdateStoreResult = Store | UnableToUpdateStore;\n\nexport type UpdateUserInput = {\n countryCode?: InputMaybe;\n email?: InputMaybe;\n facebookAttribution?: InputMaybe;\n firstName?: InputMaybe;\n foxtraxAttribution?: InputMaybe;\n lastName?: InputMaybe;\n organizationId?: InputMaybe;\n phone?: InputMaybe;\n role?: InputMaybe;\n timezone?: InputMaybe;\n};\n\nexport type UpdateUserResult = User | UserNotFound;\n\nexport type User = {\n __typename?: 'User';\n countryCode: Scalars['String'];\n email: Scalars['String'];\n facebookAttribution?: Maybe;\n firstName: Scalars['String'];\n foxtraxAttribution?: Maybe;\n id: Scalars['ID'];\n lastName: Scalars['String'];\n organization?: Maybe;\n organizationId?: Maybe;\n phone: Scalars['String'];\n role: Role;\n timezone?: Maybe;\n};\n\nexport type UserAlreadyExists = {\n __typename?: 'UserAlreadyExists';\n error: Scalars['String'];\n};\n\nexport type UserInput = {\n email?: InputMaybe;\n firstName?: InputMaybe;\n lastName?: InputMaybe;\n password?: InputMaybe;\n phone?: InputMaybe;\n role?: InputMaybe;\n};\n\nexport type UserNotFound = {\n __typename?: 'UserNotFound';\n error: Scalars['String'];\n};\n\nexport type UserStatus = {\n __typename?: 'UserStatus';\n hasInstalledShopifyApp: Scalars['Boolean'];\n hasPaidSubscription: Scalars['Boolean'];\n isConnectedToFacebook: Scalars['Boolean'];\n};\n\nexport enum VerifyChannel {\n Email = 'email',\n Sms = 'sms'\n}\n\nexport type VerifyCode = {\n code: Scalars['String'];\n email: Scalars['String'];\n};\n\nexport type VerifyCodeResult = UnableToVerifyCode | UserNotFound | VerifyCodeSuccess;\n\nexport type VerifyCodeSuccess = {\n __typename?: 'VerifyCodeSuccess';\n message: Scalars['String'];\n status: VerifyStatus;\n};\n\nexport enum VerifyStatus {\n Approved = 'approved',\n Canceled = 'canceled',\n Pending = 'pending'\n}\n\nexport type CreateOrganizationMutationVariables = Exact<{\n input: CreateOrganizationInput;\n}>;\n\n\nexport type CreateOrganizationMutation = { __typename?: 'Mutation', createOrganization?: { __typename: 'Organization', id: string, name: string, adSpend?: string | null, country?: string | null, createdAt: any, updatedAt: any } | { __typename: 'UnableToCreateOrganization', error: string } | null };\n\nexport type CreateStoreMutationVariables = Exact<{\n input: CreateStoreInput;\n}>;\n\n\nexport type CreateStoreMutation = { __typename?: 'Mutation', createStore?: { __typename: 'Store', id: string, name: string, hostname?: string | null, sourceStoreId?: string | null, organizationId: string, subscriptionId?: string | null, createdAt: any, updatedAt: any } | { __typename: 'UnableToCreateStore', error: string } | null };\n\nexport type TimezoneSettingQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type TimezoneSettingQuery = { __typename?: 'Query', viewer?: { __typename?: 'User', id: string, timezone?: string | null } | null };\n\nexport type AdManagerAccountsByStoreIdQueryVariables = Exact<{\n id: Scalars['ID'];\n}>;\n\n\nexport type AdManagerAccountsByStoreIdQuery = { __typename?: 'Query', adManagerAccountsByStoreId?: Array<{ __typename?: 'AdManagerAccount', id: string, sourceAdManagerAccountId: string, name: string, accountStatus: string, storeId: string, sourceCreatedAt?: any | null, adPlatformAccountId: string, createdAt: any, updatedAt: any }> | null };\n\nexport type LoginMutationVariables = Exact<{\n email: Scalars['String'];\n password: Scalars['String'];\n}>;\n\n\nexport type LoginMutation = { __typename?: 'Mutation', login: { __typename: 'InvalidCredentials', error: string } | { __typename: 'User', id: string, firstName: string, lastName: string, email: string, role: Role, phone: string, countryCode: string, organizationId?: string | null, timezone?: string | null } };\n\nexport type LogoutMutationVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type LogoutMutation = { __typename?: 'Mutation', logout: { __typename?: 'LogoutResult', message: string } };\n\nexport type UpdateOrganizationByIdMutationVariables = Exact<{\n id: Scalars['ID'];\n input: UpdateOrganizationInput;\n}>;\n\n\nexport type UpdateOrganizationByIdMutation = { __typename?: 'Mutation', updateOrganizationById?: { __typename: 'Organization', id: string, name: string, adSpend?: string | null, country?: string | null, createdAt: any, updatedAt: any } | { __typename: 'UnableToUpdateOrganization', error: string } | null };\n\nexport type CreateUserMutationVariables = Exact<{\n input: CreateUserInput;\n}>;\n\n\nexport type CreateUserMutation = { __typename?: 'Mutation', createUser: { __typename: 'User', id: string, firstName: string, lastName: string, email: string, role: Role, phone: string, countryCode: string, organizationId?: string | null } | { __typename: 'UserAlreadyExists', error: string } };\n\nexport type ResetUserPasswordByContextUserIdMutationVariables = Exact<{\n password: Scalars['String'];\n}>;\n\n\nexport type ResetUserPasswordByContextUserIdMutation = { __typename?: 'Mutation', resetUserPasswordByContextUserId: { __typename: 'UnableToResetPassword', error: string } | { __typename: 'User', id: string, firstName: string, lastName: string, email: string, role: Role, phone: string, organizationId?: string | null } };\n\nexport type ConnectShopifyToFoxtraxMutationVariables = Exact<{\n id: Scalars['ID'];\n input: ConnectShopifyToFoxtraxInput;\n}>;\n\n\nexport type ConnectShopifyToFoxtraxMutation = { __typename?: 'Mutation', connectShopifyToFoxtrax?: { __typename?: 'Store', id: string, name: string } | { __typename?: 'UnableToAddShopifyStore', error: string } | null };\n\nexport type CreateShopifyTokenMutationVariables = Exact<{\n input: AddShopifyStoreInput;\n}>;\n\n\nexport type CreateShopifyTokenMutation = { __typename?: 'Mutation', createShopifyToken?: { __typename?: 'ShopifyTokenResult', success: boolean, connectedToStore: boolean } | { __typename?: 'UnableToAddShopifyToken', error: string } | null };\n\nexport type GetShopifyAuthUrlQueryVariables = Exact<{\n shopifyAuthUrlInput: ShopifyAuthUrlInput;\n}>;\n\n\nexport type GetShopifyAuthUrlQuery = { __typename?: 'Query', shopifyAuthUrl?: string | null };\n\nexport type VerifyCodeMutationVariables = Exact<{\n code: Scalars['String'];\n}>;\n\n\nexport type VerifyCodeMutation = { __typename?: 'Mutation', verifyCode: { __typename: 'UnableToVerifyCode', status: VerifyStatus, error: string } | { __typename: 'UserNotFound', error: string } | { __typename: 'VerifyCodeSuccess', status: VerifyStatus, message: string } };\n\nexport type GenerateFacebookLinkMutationVariables = Exact<{\n id: Scalars['ID'];\n}>;\n\n\nexport type GenerateFacebookLinkMutation = { __typename?: 'Mutation', generateFacebookLinkByStoreId: { __typename?: 'GenerateFacebookLink', oauthLink: string, connected: boolean } };\n\nexport type DisconnectAdPlatformMutationVariables = Exact<{\n id: Scalars['ID'];\n platform: Platform;\n}>;\n\n\nexport type DisconnectAdPlatformMutation = { __typename?: 'Mutation', disconnectAdPlatformByStoreId: { __typename: 'AdPlatformAccountDoesNotExist', error?: string | null } | { __typename: 'DisconnectAdPlatform', disconnected: boolean } };\n\nexport type ProgressSubscriptionVariables = Exact<{\n progressId: Scalars['ID'];\n}>;\n\n\nexport type ProgressSubscription = { __typename?: 'Subscription', progress?: { __typename?: 'LoadingProgress', entities?: number | null, metrics?: number | null, id?: string | null } | null };\n\nexport type AdPlatformAccountsByStoreIdQueryVariables = Exact<{\n id: Scalars['ID'];\n}>;\n\n\nexport type AdPlatformAccountsByStoreIdQuery = { __typename?: 'Query', adPlatformAccountsByStoreId?: Array<{ __typename?: 'AdPlatformAccount', id: string, storeId: string, name: Platform, createdAt: any, updatedAt: any }> | null };\n\nexport type PixelConfigurationStatusByStoreIdQueryVariables = Exact<{\n id?: InputMaybe;\n}>;\n\n\nexport type PixelConfigurationStatusByStoreIdQuery = { __typename?: 'Query', pixelConfigurationStatusByStoreId: { __typename?: 'Error', error: string } | { __typename?: 'PixelConfigurationStatus', connected: boolean, lastUpdatedAt?: any | null } };\n\nexport type DownloadProgressByStoreIdQueryVariables = Exact<{\n storeId: Scalars['ID'];\n}>;\n\n\nexport type DownloadProgressByStoreIdQuery = { __typename?: 'Query', downloadProgressByStoreId?: { __typename?: 'LoadingProgressConnected', id?: string | null, entities?: number | null, metrics?: number | null, connected?: boolean | null } | null };\n\nexport type SendCodeByEmailMutationVariables = Exact<{\n email: Scalars['String'];\n channel: VerifyChannel;\n}>;\n\n\nexport type SendCodeByEmailMutation = { __typename?: 'Mutation', sendCodeByEmail: { __typename: 'SendCodeSuccess', status: VerifyStatus, message: string, expiresAt: string, sentAt: string } | { __typename: 'UnableToSendCode', status: VerifyStatus, error: string } | { __typename: 'UserNotFound', error: string } };\n\nexport type UpdateUserByIdMutationVariables = Exact<{\n id: Scalars['ID'];\n user: UpdateUserInput;\n}>;\n\n\nexport type UpdateUserByIdMutation = { __typename?: 'Mutation', updateUserById: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, role: Role, phone: string, countryCode: string, organizationId?: string | null, timezone?: string | null, organization?: { __typename?: 'Organization', id: string, name: string } | null } | { __typename?: 'UserNotFound', error: string } };\n\nexport type UserByIdQueryVariables = Exact<{\n id: Scalars['ID'];\n}>;\n\n\nexport type UserByIdQuery = { __typename?: 'Query', userById?: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, role: Role, phone: string, countryCode: string, timezone?: string | null, organizationId?: string | null } | null };\n\nexport type ViewerQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type ViewerQuery = { __typename?: 'Query', viewer?: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, role: Role, phone: string, countryCode: string, timezone?: string | null, organizationId?: string | null, foxtraxAttribution?: FoxTraxAttribution | null, facebookAttribution?: FacebookAttribution | null, organization?: { __typename?: 'Organization', name: string } | null } | null };\n\nexport type GetUserStatusQueryVariables = Exact<{\n id: Scalars['ID'];\n}>;\n\n\nexport type GetUserStatusQuery = { __typename?: 'Query', userStatusByStoreId: { __typename?: 'UserStatus', isConnectedToFacebook: boolean, hasInstalledShopifyApp: boolean, hasPaidSubscription: boolean } };\n\nexport type CampaignsByAdManagerAccountIdsQueryVariables = Exact<{\n ids: Array | Scalars['ID'];\n input?: InputMaybe;\n}>;\n\n\nexport type CampaignsByAdManagerAccountIdsQuery = { __typename?: 'Query', campaignsByAdManagerAccountIds?: { __typename?: 'CampaignList', total: number, campaigns?: Array<{ __typename?: 'Campaign', id: string, name: string, status: CampaignStatus, storeId: string, effectiveStatus: CampaignEffectiveStatus, sourceAdManagerAccountId: string, sourceCampaignId: string, adManagerAccountId: string, adPlatformAccountId: string, spend?: number | null, dailyBudget?: number | null, lifetimeBudget?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, spend?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null };\n\nexport type AdsetsByAdManagerAccountIdsQueryVariables = Exact<{\n ids: Array | Scalars['ID'];\n input?: InputMaybe;\n}>;\n\n\nexport type AdsetsByAdManagerAccountIdsQuery = { __typename?: 'Query', adsetsByAdManagerAccountIds?: { __typename?: 'AdsetList', total: number, adsets?: Array<{ __typename?: 'Adset', id: string, name: string, status: AdsetStatus, effectiveStatus: AdsetEffectiveStatus, storeId: string, adPlatformAccountId: string, sourceAdManagerAccountId: string, sourceCampaignId: string, sourceAdsetId: string, adManagerAccountId: string, campaignId?: string | null, spend?: number | null, dailyBudget?: number | null, lifetimeBudget?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, spend?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null };\n\nexport type AdsByAdManagerAccountIdsQueryVariables = Exact<{\n ids: Array | Scalars['ID'];\n input?: InputMaybe;\n}>;\n\n\nexport type AdsByAdManagerAccountIdsQuery = { __typename?: 'Query', adsByAdManagerAccountIds?: { __typename?: 'AdList', total: number, ads?: Array<{ __typename?: 'Ad', id: string, name: string, status: AdStatus, effectiveStatus: AdEffectiveStatus, productLink?: string | null, copy?: string | null, headline?: string | null, mediaUrl?: string | null, storeId: string, adPlatformAccountId: string, sourceAdManagerAccountId: string, sourceCampaignId: string, sourceAdsetId: string, sourceAdId: string, adManagerAccountId: string, campaignId?: string | null, adsetId?: string | null, spend?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, spend?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null };\n\nexport type CampaignsAdsetsAdsByAdManagerAccountIdsQueryVariables = Exact<{\n ids: Array | Scalars['ID'];\n campaignsInput?: InputMaybe;\n adsetsInput?: InputMaybe;\n adsInput?: InputMaybe;\n}>;\n\n\nexport type CampaignsAdsetsAdsByAdManagerAccountIdsQuery = { __typename?: 'Query', campaignsByAdManagerAccountIds?: { __typename?: 'CampaignList', total: number, campaigns?: Array<{ __typename?: 'Campaign', id: string, name: string, status: CampaignStatus, storeId: string, effectiveStatus: CampaignEffectiveStatus, sourceAdManagerAccountId: string, sourceCampaignId: string, adManagerAccountId: string, adPlatformAccountId: string, spend?: number | null, dailyBudget?: number | null, lifetimeBudget?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, spend?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null, adsetsByAdManagerAccountIds?: { __typename?: 'AdsetList', total: number, adsets?: Array<{ __typename?: 'Adset', id: string, name: string, status: AdsetStatus, effectiveStatus: AdsetEffectiveStatus, storeId: string, adPlatformAccountId: string, sourceAdManagerAccountId: string, sourceCampaignId: string, sourceAdsetId: string, adManagerAccountId: string, campaignId?: string | null, spend?: number | null, dailyBudget?: number | null, lifetimeBudget?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, spend?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null, adsByAdManagerAccountIds?: { __typename?: 'AdList', total: number, ads?: Array<{ __typename?: 'Ad', id: string, name: string, status: AdStatus, effectiveStatus: AdEffectiveStatus, productLink?: string | null, copy?: string | null, headline?: string | null, mediaUrl?: string | null, storeId: string, adPlatformAccountId: string, sourceAdManagerAccountId: string, sourceCampaignId: string, sourceAdsetId: string, sourceAdId: string, adManagerAccountId: string, campaignId?: string | null, adsetId?: string | null, spend?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, spend?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null };\n\nexport type AdsetsAdsByAdManagerAccountIdsQueryVariables = Exact<{\n ids: Array | Scalars['ID'];\n adsetsInput?: InputMaybe;\n adsInput?: InputMaybe;\n}>;\n\n\nexport type AdsetsAdsByAdManagerAccountIdsQuery = { __typename?: 'Query', adsetsByAdManagerAccountIds?: { __typename?: 'AdsetList', total: number, adsets?: Array<{ __typename?: 'Adset', id: string, name: string, status: AdsetStatus, effectiveStatus: AdsetEffectiveStatus, storeId: string, adPlatformAccountId: string, sourceAdManagerAccountId: string, sourceCampaignId: string, sourceAdsetId: string, adManagerAccountId: string, campaignId?: string | null, spend?: number | null, dailyBudget?: number | null, lifetimeBudget?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, spend?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null, adsByAdManagerAccountIds?: { __typename?: 'AdList', total: number, ads?: Array<{ __typename?: 'Ad', id: string, name: string, status: AdStatus, effectiveStatus: AdEffectiveStatus, productLink?: string | null, copy?: string | null, headline?: string | null, mediaUrl?: string | null, storeId: string, adPlatformAccountId: string, sourceAdManagerAccountId: string, sourceCampaignId: string, sourceAdsetId: string, sourceAdId: string, adManagerAccountId: string, campaignId?: string | null, adsetId?: string | null, spend?: number | null, orders?: number | null, ordersValue?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null, createdAt: any, updatedAt: any, sourceCreatedAt?: any | null }> | null, aggregates: { __typename?: 'AggregateTotals', orders?: number | null, ordersValue?: number | null, spend?: number | null, sourceOrders?: number | null, sourceOrdersValue?: number | null }, totals: { __typename?: 'Totals', spend: number, dailyBudget?: number | null, orders: { __typename?: 'OrderMetrics', total: number, attributed: number, facebook: number, organic: number }, revenue: { __typename?: 'RevenueMetrics', total: number, attributed: number, facebook: number, organic: number } } } | null };\n\nexport type ShopifyInstallUrlQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type ShopifyInstallUrlQuery = { __typename?: 'Query', shopifyInstallUrl?: string | null };\n\nexport type SubscriptionLinkMutationVariables = Exact<{\n id: Scalars['ID'];\n input: CreateCheckoutSessionInput;\n}>;\n\n\nexport type SubscriptionLinkMutation = { __typename?: 'Mutation', createCheckoutSessionByStoreId?: { __typename?: 'CheckoutSession', sessionUrl: string } | { __typename?: 'SubscriptionAlreadyCreated', message: string, subscriptionPlan: { __typename?: 'SubscriptionPlan', id: string, organizationId: string, subscriptionId: string, planId: string, currentPeriodStart: any, currentPeriodEnd: any, storeId: string, status: SubscriptionPlanStatus, createdAt: any, updatedAt: any, canceledAt?: any | null } } | { __typename?: 'UnableToCreateCheckoutSession', error: string } | null };\n\nexport type CreateBillingPortalByStoreIdMutationVariables = Exact<{\n id: Scalars['ID'];\n input: CreateBillingPortalInput;\n}>;\n\n\nexport type CreateBillingPortalByStoreIdMutation = { __typename?: 'Mutation', createBillingPortalByStoreId?: { __typename?: 'BillingPortal', sessionUrl: string } | { __typename?: 'Error', error: string } | null };\n\nexport type SubscriptionPlanByStoreIdQueryVariables = Exact<{\n storeId: Scalars['ID'];\n}>;\n\n\nexport type SubscriptionPlanByStoreIdQuery = { __typename?: 'Query', subscriptionPlanByStoreId?: { __typename?: 'Error', error: string } | { __typename?: 'SubscriptionPlan', id: string, organizationId: string, subscriptionId: string, planId: string, currentPeriodStart: any, currentPeriodEnd: any, storeId: string, isYearly?: boolean | null, status: SubscriptionPlanStatus, createdAt: any, updatedAt: any, canceledAt?: any | null } | null };\n\n\nexport const CreateOrganizationDocument = gql`\n mutation CreateOrganization($input: CreateOrganizationInput!) {\n createOrganization(input: $input) {\n __typename\n ... on Organization {\n id\n name\n adSpend\n country\n createdAt\n updatedAt\n }\n ... on UnableToCreateOrganization {\n error\n }\n }\n}\n `;\nexport type CreateOrganizationMutationFn = Apollo.MutationFunction;\n\n/**\n * __useCreateOrganizationMutation__\n *\n * To run a mutation, you first call `useCreateOrganizationMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateOrganizationMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createOrganizationMutation, { data, loading, error }] = useCreateOrganizationMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateOrganizationMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(CreateOrganizationDocument, options);\n }\nexport type CreateOrganizationMutationHookResult = ReturnType;\nexport type CreateOrganizationMutationResult = Apollo.MutationResult;\nexport type CreateOrganizationMutationOptions = Apollo.BaseMutationOptions;\nexport const CreateStoreDocument = gql`\n mutation CreateStore($input: CreateStoreInput!) {\n createStore(input: $input) {\n __typename\n ... on Store {\n id\n name\n hostname\n sourceStoreId\n organizationId\n subscriptionId\n createdAt\n updatedAt\n }\n ... on UnableToCreateStore {\n error\n }\n }\n}\n `;\nexport type CreateStoreMutationFn = Apollo.MutationFunction;\n\n/**\n * __useCreateStoreMutation__\n *\n * To run a mutation, you first call `useCreateStoreMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateStoreMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createStoreMutation, { data, loading, error }] = useCreateStoreMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateStoreMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(CreateStoreDocument, options);\n }\nexport type CreateStoreMutationHookResult = ReturnType;\nexport type CreateStoreMutationResult = Apollo.MutationResult;\nexport type CreateStoreMutationOptions = Apollo.BaseMutationOptions;\nexport const TimezoneSettingDocument = gql`\n query TimezoneSetting {\n viewer {\n id\n timezone\n }\n}\n `;\n\n/**\n * __useTimezoneSettingQuery__\n *\n * To run a query within a React component, call `useTimezoneSettingQuery` and pass it any options that fit your needs.\n * When your component renders, `useTimezoneSettingQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useTimezoneSettingQuery({\n * variables: {\n * },\n * });\n */\nexport function useTimezoneSettingQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(TimezoneSettingDocument, options);\n }\nexport function useTimezoneSettingLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(TimezoneSettingDocument, options);\n }\nexport type TimezoneSettingQueryHookResult = ReturnType;\nexport type TimezoneSettingLazyQueryHookResult = ReturnType;\nexport type TimezoneSettingQueryResult = Apollo.QueryResult;\nexport const AdManagerAccountsByStoreIdDocument = gql`\n query AdManagerAccountsByStoreId($id: ID!) {\n adManagerAccountsByStoreId(id: $id) {\n id\n sourceAdManagerAccountId\n name\n accountStatus\n storeId\n sourceCreatedAt\n sourceAdManagerAccountId\n adPlatformAccountId\n createdAt\n updatedAt\n }\n}\n `;\n\n/**\n * __useAdManagerAccountsByStoreIdQuery__\n *\n * To run a query within a React component, call `useAdManagerAccountsByStoreIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useAdManagerAccountsByStoreIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useAdManagerAccountsByStoreIdQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useAdManagerAccountsByStoreIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(AdManagerAccountsByStoreIdDocument, options);\n }\nexport function useAdManagerAccountsByStoreIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(AdManagerAccountsByStoreIdDocument, options);\n }\nexport type AdManagerAccountsByStoreIdQueryHookResult = ReturnType;\nexport type AdManagerAccountsByStoreIdLazyQueryHookResult = ReturnType;\nexport type AdManagerAccountsByStoreIdQueryResult = Apollo.QueryResult;\nexport const LoginDocument = gql`\n mutation Login($email: String!, $password: String!) {\n login(email: $email, password: $password) {\n __typename\n ... on User {\n id\n firstName\n lastName\n email\n role\n phone\n countryCode\n organizationId\n timezone\n }\n ... on InvalidCredentials {\n error\n }\n }\n}\n `;\nexport type LoginMutationFn = Apollo.MutationFunction;\n\n/**\n * __useLoginMutation__\n *\n * To run a mutation, you first call `useLoginMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useLoginMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [loginMutation, { data, loading, error }] = useLoginMutation({\n * variables: {\n * email: // value for 'email'\n * password: // value for 'password'\n * },\n * });\n */\nexport function useLoginMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(LoginDocument, options);\n }\nexport type LoginMutationHookResult = ReturnType;\nexport type LoginMutationResult = Apollo.MutationResult;\nexport type LoginMutationOptions = Apollo.BaseMutationOptions;\nexport const LogoutDocument = gql`\n mutation Logout {\n logout {\n message\n }\n}\n `;\nexport type LogoutMutationFn = Apollo.MutationFunction;\n\n/**\n * __useLogoutMutation__\n *\n * To run a mutation, you first call `useLogoutMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useLogoutMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [logoutMutation, { data, loading, error }] = useLogoutMutation({\n * variables: {\n * },\n * });\n */\nexport function useLogoutMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(LogoutDocument, options);\n }\nexport type LogoutMutationHookResult = ReturnType;\nexport type LogoutMutationResult = Apollo.MutationResult;\nexport type LogoutMutationOptions = Apollo.BaseMutationOptions;\nexport const UpdateOrganizationByIdDocument = gql`\n mutation UpdateOrganizationById($id: ID!, $input: UpdateOrganizationInput!) {\n updateOrganizationById(id: $id, input: $input) {\n __typename\n ... on Organization {\n id\n name\n adSpend\n country\n createdAt\n updatedAt\n }\n ... on UnableToUpdateOrganization {\n error\n }\n }\n}\n `;\nexport type UpdateOrganizationByIdMutationFn = Apollo.MutationFunction;\n\n/**\n * __useUpdateOrganizationByIdMutation__\n *\n * To run a mutation, you first call `useUpdateOrganizationByIdMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateOrganizationByIdMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateOrganizationByIdMutation, { data, loading, error }] = useUpdateOrganizationByIdMutation({\n * variables: {\n * id: // value for 'id'\n * input: // value for 'input'\n * },\n * });\n */\nexport function useUpdateOrganizationByIdMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(UpdateOrganizationByIdDocument, options);\n }\nexport type UpdateOrganizationByIdMutationHookResult = ReturnType;\nexport type UpdateOrganizationByIdMutationResult = Apollo.MutationResult;\nexport type UpdateOrganizationByIdMutationOptions = Apollo.BaseMutationOptions;\nexport const CreateUserDocument = gql`\n mutation CreateUser($input: CreateUserInput!) {\n createUser(input: $input) {\n __typename\n ... on User {\n id\n firstName\n lastName\n email\n role\n phone\n countryCode\n organizationId\n }\n ... on UserAlreadyExists {\n error\n }\n }\n}\n `;\nexport type CreateUserMutationFn = Apollo.MutationFunction;\n\n/**\n * __useCreateUserMutation__\n *\n * To run a mutation, you first call `useCreateUserMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateUserMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createUserMutation, { data, loading, error }] = useCreateUserMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateUserMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(CreateUserDocument, options);\n }\nexport type CreateUserMutationHookResult = ReturnType;\nexport type CreateUserMutationResult = Apollo.MutationResult;\nexport type CreateUserMutationOptions = Apollo.BaseMutationOptions;\nexport const ResetUserPasswordByContextUserIdDocument = gql`\n mutation ResetUserPasswordByContextUserId($password: String!) {\n resetUserPasswordByContextUserId(password: $password) {\n __typename\n ... on User {\n id\n firstName\n lastName\n email\n role\n phone\n organizationId\n }\n ... on UnableToResetPassword {\n error\n }\n }\n}\n `;\nexport type ResetUserPasswordByContextUserIdMutationFn = Apollo.MutationFunction;\n\n/**\n * __useResetUserPasswordByContextUserIdMutation__\n *\n * To run a mutation, you first call `useResetUserPasswordByContextUserIdMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useResetUserPasswordByContextUserIdMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [resetUserPasswordByContextUserIdMutation, { data, loading, error }] = useResetUserPasswordByContextUserIdMutation({\n * variables: {\n * password: // value for 'password'\n * },\n * });\n */\nexport function useResetUserPasswordByContextUserIdMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(ResetUserPasswordByContextUserIdDocument, options);\n }\nexport type ResetUserPasswordByContextUserIdMutationHookResult = ReturnType;\nexport type ResetUserPasswordByContextUserIdMutationResult = Apollo.MutationResult;\nexport type ResetUserPasswordByContextUserIdMutationOptions = Apollo.BaseMutationOptions;\nexport const ConnectShopifyToFoxtraxDocument = gql`\n mutation ConnectShopifyToFoxtrax($id: ID!, $input: ConnectShopifyToFoxtraxInput!) {\n connectShopifyToFoxtrax(id: $id, input: $input) {\n ... on Store {\n id\n name\n }\n ... on UnableToAddShopifyStore {\n error\n }\n }\n}\n `;\nexport type ConnectShopifyToFoxtraxMutationFn = Apollo.MutationFunction;\n\n/**\n * __useConnectShopifyToFoxtraxMutation__\n *\n * To run a mutation, you first call `useConnectShopifyToFoxtraxMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useConnectShopifyToFoxtraxMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [connectShopifyToFoxtraxMutation, { data, loading, error }] = useConnectShopifyToFoxtraxMutation({\n * variables: {\n * id: // value for 'id'\n * input: // value for 'input'\n * },\n * });\n */\nexport function useConnectShopifyToFoxtraxMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(ConnectShopifyToFoxtraxDocument, options);\n }\nexport type ConnectShopifyToFoxtraxMutationHookResult = ReturnType;\nexport type ConnectShopifyToFoxtraxMutationResult = Apollo.MutationResult;\nexport type ConnectShopifyToFoxtraxMutationOptions = Apollo.BaseMutationOptions;\nexport const CreateShopifyTokenDocument = gql`\n mutation CreateShopifyToken($input: AddShopifyStoreInput!) {\n createShopifyToken(input: $input) {\n ... on ShopifyTokenResult {\n success\n connectedToStore\n }\n ... on UnableToAddShopifyToken {\n error\n }\n }\n}\n `;\nexport type CreateShopifyTokenMutationFn = Apollo.MutationFunction;\n\n/**\n * __useCreateShopifyTokenMutation__\n *\n * To run a mutation, you first call `useCreateShopifyTokenMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateShopifyTokenMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createShopifyTokenMutation, { data, loading, error }] = useCreateShopifyTokenMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateShopifyTokenMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(CreateShopifyTokenDocument, options);\n }\nexport type CreateShopifyTokenMutationHookResult = ReturnType;\nexport type CreateShopifyTokenMutationResult = Apollo.MutationResult;\nexport type CreateShopifyTokenMutationOptions = Apollo.BaseMutationOptions;\nexport const GetShopifyAuthUrlDocument = gql`\n query GetShopifyAuthUrl($shopifyAuthUrlInput: ShopifyAuthUrlInput!) {\n shopifyAuthUrl(input: $shopifyAuthUrlInput)\n}\n `;\n\n/**\n * __useGetShopifyAuthUrlQuery__\n *\n * To run a query within a React component, call `useGetShopifyAuthUrlQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetShopifyAuthUrlQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetShopifyAuthUrlQuery({\n * variables: {\n * shopifyAuthUrlInput: // value for 'shopifyAuthUrlInput'\n * },\n * });\n */\nexport function useGetShopifyAuthUrlQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(GetShopifyAuthUrlDocument, options);\n }\nexport function useGetShopifyAuthUrlLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(GetShopifyAuthUrlDocument, options);\n }\nexport type GetShopifyAuthUrlQueryHookResult = ReturnType;\nexport type GetShopifyAuthUrlLazyQueryHookResult = ReturnType;\nexport type GetShopifyAuthUrlQueryResult = Apollo.QueryResult;\nexport const VerifyCodeDocument = gql`\n mutation VerifyCode($code: String!) {\n verifyCode(code: $code) {\n __typename\n ... on VerifyCodeSuccess {\n status\n message\n }\n ... on UserNotFound {\n error\n }\n ... on UnableToVerifyCode {\n status\n error\n }\n }\n}\n `;\nexport type VerifyCodeMutationFn = Apollo.MutationFunction;\n\n/**\n * __useVerifyCodeMutation__\n *\n * To run a mutation, you first call `useVerifyCodeMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useVerifyCodeMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [verifyCodeMutation, { data, loading, error }] = useVerifyCodeMutation({\n * variables: {\n * code: // value for 'code'\n * },\n * });\n */\nexport function useVerifyCodeMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(VerifyCodeDocument, options);\n }\nexport type VerifyCodeMutationHookResult = ReturnType;\nexport type VerifyCodeMutationResult = Apollo.MutationResult;\nexport type VerifyCodeMutationOptions = Apollo.BaseMutationOptions;\nexport const GenerateFacebookLinkDocument = gql`\n mutation GenerateFacebookLink($id: ID!) {\n generateFacebookLinkByStoreId(id: $id) {\n oauthLink\n connected\n }\n}\n `;\nexport type GenerateFacebookLinkMutationFn = Apollo.MutationFunction;\n\n/**\n * __useGenerateFacebookLinkMutation__\n *\n * To run a mutation, you first call `useGenerateFacebookLinkMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useGenerateFacebookLinkMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [generateFacebookLinkMutation, { data, loading, error }] = useGenerateFacebookLinkMutation({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useGenerateFacebookLinkMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(GenerateFacebookLinkDocument, options);\n }\nexport type GenerateFacebookLinkMutationHookResult = ReturnType;\nexport type GenerateFacebookLinkMutationResult = Apollo.MutationResult;\nexport type GenerateFacebookLinkMutationOptions = Apollo.BaseMutationOptions;\nexport const DisconnectAdPlatformDocument = gql`\n mutation DisconnectAdPlatform($id: ID!, $platform: Platform!) {\n disconnectAdPlatformByStoreId(id: $id, platform: $platform) {\n __typename\n ... on DisconnectAdPlatform {\n disconnected\n }\n ... on AdPlatformAccountDoesNotExist {\n error\n }\n }\n}\n `;\nexport type DisconnectAdPlatformMutationFn = Apollo.MutationFunction;\n\n/**\n * __useDisconnectAdPlatformMutation__\n *\n * To run a mutation, you first call `useDisconnectAdPlatformMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useDisconnectAdPlatformMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [disconnectAdPlatformMutation, { data, loading, error }] = useDisconnectAdPlatformMutation({\n * variables: {\n * id: // value for 'id'\n * platform: // value for 'platform'\n * },\n * });\n */\nexport function useDisconnectAdPlatformMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(DisconnectAdPlatformDocument, options);\n }\nexport type DisconnectAdPlatformMutationHookResult = ReturnType;\nexport type DisconnectAdPlatformMutationResult = Apollo.MutationResult;\nexport type DisconnectAdPlatformMutationOptions = Apollo.BaseMutationOptions;\nexport const ProgressDocument = gql`\n subscription Progress($progressId: ID!) {\n progress(id: $progressId) {\n entities\n metrics\n id\n }\n}\n `;\n\n/**\n * __useProgressSubscription__\n *\n * To run a query within a React component, call `useProgressSubscription` and pass it any options that fit your needs.\n * When your component renders, `useProgressSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useProgressSubscription({\n * variables: {\n * progressId: // value for 'progressId'\n * },\n * });\n */\nexport function useProgressSubscription(baseOptions: Apollo.SubscriptionHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useSubscription(ProgressDocument, options);\n }\nexport type ProgressSubscriptionHookResult = ReturnType;\nexport type ProgressSubscriptionResult = Apollo.SubscriptionResult;\nexport const AdPlatformAccountsByStoreIdDocument = gql`\n query AdPlatformAccountsByStoreId($id: ID!) {\n adPlatformAccountsByStoreId(id: $id) {\n id\n storeId\n name\n createdAt\n updatedAt\n }\n}\n `;\n\n/**\n * __useAdPlatformAccountsByStoreIdQuery__\n *\n * To run a query within a React component, call `useAdPlatformAccountsByStoreIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useAdPlatformAccountsByStoreIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useAdPlatformAccountsByStoreIdQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useAdPlatformAccountsByStoreIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(AdPlatformAccountsByStoreIdDocument, options);\n }\nexport function useAdPlatformAccountsByStoreIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(AdPlatformAccountsByStoreIdDocument, options);\n }\nexport type AdPlatformAccountsByStoreIdQueryHookResult = ReturnType;\nexport type AdPlatformAccountsByStoreIdLazyQueryHookResult = ReturnType;\nexport type AdPlatformAccountsByStoreIdQueryResult = Apollo.QueryResult;\nexport const PixelConfigurationStatusByStoreIdDocument = gql`\n query PixelConfigurationStatusByStoreId($id: String) {\n pixelConfigurationStatusByStoreId(id: $id) {\n ... on PixelConfigurationStatus {\n connected\n lastUpdatedAt\n }\n ... on Error {\n error\n }\n }\n}\n `;\n\n/**\n * __usePixelConfigurationStatusByStoreIdQuery__\n *\n * To run a query within a React component, call `usePixelConfigurationStatusByStoreIdQuery` and pass it any options that fit your needs.\n * When your component renders, `usePixelConfigurationStatusByStoreIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = usePixelConfigurationStatusByStoreIdQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function usePixelConfigurationStatusByStoreIdQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(PixelConfigurationStatusByStoreIdDocument, options);\n }\nexport function usePixelConfigurationStatusByStoreIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(PixelConfigurationStatusByStoreIdDocument, options);\n }\nexport type PixelConfigurationStatusByStoreIdQueryHookResult = ReturnType;\nexport type PixelConfigurationStatusByStoreIdLazyQueryHookResult = ReturnType;\nexport type PixelConfigurationStatusByStoreIdQueryResult = Apollo.QueryResult;\nexport const DownloadProgressByStoreIdDocument = gql`\n query DownloadProgressByStoreId($storeId: ID!) {\n downloadProgressByStoreId(id: $storeId) {\n id\n entities\n metrics\n connected\n }\n}\n `;\n\n/**\n * __useDownloadProgressByStoreIdQuery__\n *\n * To run a query within a React component, call `useDownloadProgressByStoreIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useDownloadProgressByStoreIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useDownloadProgressByStoreIdQuery({\n * variables: {\n * storeId: // value for 'storeId'\n * },\n * });\n */\nexport function useDownloadProgressByStoreIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(DownloadProgressByStoreIdDocument, options);\n }\nexport function useDownloadProgressByStoreIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(DownloadProgressByStoreIdDocument, options);\n }\nexport type DownloadProgressByStoreIdQueryHookResult = ReturnType;\nexport type DownloadProgressByStoreIdLazyQueryHookResult = ReturnType;\nexport type DownloadProgressByStoreIdQueryResult = Apollo.QueryResult;\nexport const SendCodeByEmailDocument = gql`\n mutation SendCodeByEmail($email: String!, $channel: VerifyChannel!) {\n sendCodeByEmail(email: $email, channel: $channel) {\n __typename\n ... on SendCodeSuccess {\n status\n message\n expiresAt\n sentAt\n }\n ... on UnableToSendCode {\n status\n error\n }\n ... on UserNotFound {\n error\n }\n }\n}\n `;\nexport type SendCodeByEmailMutationFn = Apollo.MutationFunction;\n\n/**\n * __useSendCodeByEmailMutation__\n *\n * To run a mutation, you first call `useSendCodeByEmailMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useSendCodeByEmailMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [sendCodeByEmailMutation, { data, loading, error }] = useSendCodeByEmailMutation({\n * variables: {\n * email: // value for 'email'\n * channel: // value for 'channel'\n * },\n * });\n */\nexport function useSendCodeByEmailMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(SendCodeByEmailDocument, options);\n }\nexport type SendCodeByEmailMutationHookResult = ReturnType;\nexport type SendCodeByEmailMutationResult = Apollo.MutationResult;\nexport type SendCodeByEmailMutationOptions = Apollo.BaseMutationOptions;\nexport const UpdateUserByIdDocument = gql`\n mutation UpdateUserById($id: ID!, $user: UpdateUserInput!) {\n updateUserById(id: $id, user: $user) {\n ... on User {\n id\n firstName\n lastName\n email\n role\n phone\n countryCode\n organization {\n id\n name\n }\n organizationId\n timezone\n }\n ... on UserNotFound {\n error\n }\n }\n}\n `;\nexport type UpdateUserByIdMutationFn = Apollo.MutationFunction;\n\n/**\n * __useUpdateUserByIdMutation__\n *\n * To run a mutation, you first call `useUpdateUserByIdMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateUserByIdMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateUserByIdMutation, { data, loading, error }] = useUpdateUserByIdMutation({\n * variables: {\n * id: // value for 'id'\n * user: // value for 'user'\n * },\n * });\n */\nexport function useUpdateUserByIdMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(UpdateUserByIdDocument, options);\n }\nexport type UpdateUserByIdMutationHookResult = ReturnType;\nexport type UpdateUserByIdMutationResult = Apollo.MutationResult;\nexport type UpdateUserByIdMutationOptions = Apollo.BaseMutationOptions;\nexport const UserByIdDocument = gql`\n query UserById($id: ID!) {\n userById(id: $id) {\n id\n firstName\n lastName\n email\n role\n phone\n countryCode\n timezone\n organizationId\n }\n}\n `;\n\n/**\n * __useUserByIdQuery__\n *\n * To run a query within a React component, call `useUserByIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useUserByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useUserByIdQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useUserByIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(UserByIdDocument, options);\n }\nexport function useUserByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(UserByIdDocument, options);\n }\nexport type UserByIdQueryHookResult = ReturnType;\nexport type UserByIdLazyQueryHookResult = ReturnType;\nexport type UserByIdQueryResult = Apollo.QueryResult;\nexport const ViewerDocument = gql`\n query Viewer {\n viewer {\n id\n firstName\n lastName\n email\n role\n phone\n countryCode\n timezone\n organizationId\n foxtraxAttribution\n facebookAttribution\n organization {\n name\n }\n }\n}\n `;\n\n/**\n * __useViewerQuery__\n *\n * To run a query within a React component, call `useViewerQuery` and pass it any options that fit your needs.\n * When your component renders, `useViewerQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useViewerQuery({\n * variables: {\n * },\n * });\n */\nexport function useViewerQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(ViewerDocument, options);\n }\nexport function useViewerLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(ViewerDocument, options);\n }\nexport type ViewerQueryHookResult = ReturnType;\nexport type ViewerLazyQueryHookResult = ReturnType;\nexport type ViewerQueryResult = Apollo.QueryResult;\nexport const GetUserStatusDocument = gql`\n query GetUserStatus($id: ID!) {\n userStatusByStoreId(id: $id) {\n isConnectedToFacebook\n hasInstalledShopifyApp\n hasPaidSubscription\n }\n}\n `;\n\n/**\n * __useGetUserStatusQuery__\n *\n * To run a query within a React component, call `useGetUserStatusQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetUserStatusQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetUserStatusQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useGetUserStatusQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(GetUserStatusDocument, options);\n }\nexport function useGetUserStatusLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(GetUserStatusDocument, options);\n }\nexport type GetUserStatusQueryHookResult = ReturnType;\nexport type GetUserStatusLazyQueryHookResult = ReturnType;\nexport type GetUserStatusQueryResult = Apollo.QueryResult;\nexport const CampaignsByAdManagerAccountIdsDocument = gql`\n query CampaignsByAdManagerAccountIds($ids: [ID!]!, $input: CampaignsByAdManagerAccountIdsQueryInput) {\n campaignsByAdManagerAccountIds(ids: $ids, input: $input) {\n campaigns {\n id\n name\n status\n storeId\n effectiveStatus\n sourceAdManagerAccountId\n sourceCampaignId\n adManagerAccountId\n adPlatformAccountId\n spend\n dailyBudget\n lifetimeBudget\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n spend\n sourceOrders\n sourceOrdersValue\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n}\n `;\n\n/**\n * __useCampaignsByAdManagerAccountIdsQuery__\n *\n * To run a query within a React component, call `useCampaignsByAdManagerAccountIdsQuery` and pass it any options that fit your needs.\n * When your component renders, `useCampaignsByAdManagerAccountIdsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCampaignsByAdManagerAccountIdsQuery({\n * variables: {\n * ids: // value for 'ids'\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCampaignsByAdManagerAccountIdsQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CampaignsByAdManagerAccountIdsDocument, options);\n }\nexport function useCampaignsByAdManagerAccountIdsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CampaignsByAdManagerAccountIdsDocument, options);\n }\nexport type CampaignsByAdManagerAccountIdsQueryHookResult = ReturnType;\nexport type CampaignsByAdManagerAccountIdsLazyQueryHookResult = ReturnType;\nexport type CampaignsByAdManagerAccountIdsQueryResult = Apollo.QueryResult;\nexport const AdsetsByAdManagerAccountIdsDocument = gql`\n query AdsetsByAdManagerAccountIds($ids: [ID!]!, $input: AdsetsByAdManagerAccountIdsQueryInput) {\n adsetsByAdManagerAccountIds(ids: $ids, input: $input) {\n adsets {\n id\n name\n status\n effectiveStatus\n storeId\n adPlatformAccountId\n sourceAdManagerAccountId\n sourceCampaignId\n sourceAdsetId\n adManagerAccountId\n campaignId\n spend\n dailyBudget\n lifetimeBudget\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n spend\n sourceOrders\n sourceOrdersValue\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n}\n `;\n\n/**\n * __useAdsetsByAdManagerAccountIdsQuery__\n *\n * To run a query within a React component, call `useAdsetsByAdManagerAccountIdsQuery` and pass it any options that fit your needs.\n * When your component renders, `useAdsetsByAdManagerAccountIdsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useAdsetsByAdManagerAccountIdsQuery({\n * variables: {\n * ids: // value for 'ids'\n * input: // value for 'input'\n * },\n * });\n */\nexport function useAdsetsByAdManagerAccountIdsQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(AdsetsByAdManagerAccountIdsDocument, options);\n }\nexport function useAdsetsByAdManagerAccountIdsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(AdsetsByAdManagerAccountIdsDocument, options);\n }\nexport type AdsetsByAdManagerAccountIdsQueryHookResult = ReturnType;\nexport type AdsetsByAdManagerAccountIdsLazyQueryHookResult = ReturnType;\nexport type AdsetsByAdManagerAccountIdsQueryResult = Apollo.QueryResult;\nexport const AdsByAdManagerAccountIdsDocument = gql`\n query AdsByAdManagerAccountIds($ids: [ID!]!, $input: AdsByAdManagerAccountIdsQueryInput) {\n adsByAdManagerAccountIds(ids: $ids, input: $input) {\n ads {\n id\n name\n status\n effectiveStatus\n productLink\n copy\n headline\n mediaUrl\n storeId\n adPlatformAccountId\n sourceAdManagerAccountId\n sourceCampaignId\n sourceAdsetId\n sourceAdId\n adManagerAccountId\n campaignId\n adsetId\n spend\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n spend\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n}\n `;\n\n/**\n * __useAdsByAdManagerAccountIdsQuery__\n *\n * To run a query within a React component, call `useAdsByAdManagerAccountIdsQuery` and pass it any options that fit your needs.\n * When your component renders, `useAdsByAdManagerAccountIdsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useAdsByAdManagerAccountIdsQuery({\n * variables: {\n * ids: // value for 'ids'\n * input: // value for 'input'\n * },\n * });\n */\nexport function useAdsByAdManagerAccountIdsQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(AdsByAdManagerAccountIdsDocument, options);\n }\nexport function useAdsByAdManagerAccountIdsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(AdsByAdManagerAccountIdsDocument, options);\n }\nexport type AdsByAdManagerAccountIdsQueryHookResult = ReturnType;\nexport type AdsByAdManagerAccountIdsLazyQueryHookResult = ReturnType;\nexport type AdsByAdManagerAccountIdsQueryResult = Apollo.QueryResult;\nexport const CampaignsAdsetsAdsByAdManagerAccountIdsDocument = gql`\n query CampaignsAdsetsAdsByAdManagerAccountIds($ids: [ID!]!, $campaignsInput: CampaignsByAdManagerAccountIdsQueryInput, $adsetsInput: AdsetsByAdManagerAccountIdsQueryInput, $adsInput: AdsByAdManagerAccountIdsQueryInput) {\n campaignsByAdManagerAccountIds(ids: $ids, input: $campaignsInput) {\n campaigns {\n id\n name\n status\n storeId\n effectiveStatus\n sourceAdManagerAccountId\n sourceCampaignId\n adManagerAccountId\n adPlatformAccountId\n spend\n dailyBudget\n lifetimeBudget\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n spend\n sourceOrders\n sourceOrdersValue\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n adsetsByAdManagerAccountIds(ids: $ids, input: $adsetsInput) {\n adsets {\n id\n name\n status\n effectiveStatus\n storeId\n adPlatformAccountId\n sourceAdManagerAccountId\n sourceCampaignId\n sourceAdsetId\n adManagerAccountId\n campaignId\n spend\n dailyBudget\n lifetimeBudget\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n spend\n sourceOrders\n sourceOrdersValue\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n adsByAdManagerAccountIds(ids: $ids, input: $adsInput) {\n ads {\n id\n name\n status\n effectiveStatus\n productLink\n copy\n headline\n mediaUrl\n storeId\n adPlatformAccountId\n sourceAdManagerAccountId\n sourceCampaignId\n sourceAdsetId\n sourceAdId\n adManagerAccountId\n campaignId\n adsetId\n spend\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n spend\n sourceOrders\n sourceOrdersValue\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n}\n `;\n\n/**\n * __useCampaignsAdsetsAdsByAdManagerAccountIdsQuery__\n *\n * To run a query within a React component, call `useCampaignsAdsetsAdsByAdManagerAccountIdsQuery` and pass it any options that fit your needs.\n * When your component renders, `useCampaignsAdsetsAdsByAdManagerAccountIdsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCampaignsAdsetsAdsByAdManagerAccountIdsQuery({\n * variables: {\n * ids: // value for 'ids'\n * campaignsInput: // value for 'campaignsInput'\n * adsetsInput: // value for 'adsetsInput'\n * adsInput: // value for 'adsInput'\n * },\n * });\n */\nexport function useCampaignsAdsetsAdsByAdManagerAccountIdsQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CampaignsAdsetsAdsByAdManagerAccountIdsDocument, options);\n }\nexport function useCampaignsAdsetsAdsByAdManagerAccountIdsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CampaignsAdsetsAdsByAdManagerAccountIdsDocument, options);\n }\nexport type CampaignsAdsetsAdsByAdManagerAccountIdsQueryHookResult = ReturnType;\nexport type CampaignsAdsetsAdsByAdManagerAccountIdsLazyQueryHookResult = ReturnType;\nexport type CampaignsAdsetsAdsByAdManagerAccountIdsQueryResult = Apollo.QueryResult;\nexport const AdsetsAdsByAdManagerAccountIdsDocument = gql`\n query AdsetsAdsByAdManagerAccountIds($ids: [ID!]!, $adsetsInput: AdsetsByAdManagerAccountIdsQueryInput, $adsInput: AdsByAdManagerAccountIdsQueryInput) {\n adsetsByAdManagerAccountIds(ids: $ids, input: $adsetsInput) {\n adsets {\n id\n name\n status\n effectiveStatus\n storeId\n adPlatformAccountId\n sourceAdManagerAccountId\n sourceCampaignId\n sourceAdsetId\n adManagerAccountId\n campaignId\n spend\n dailyBudget\n lifetimeBudget\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n spend\n sourceOrders\n sourceOrdersValue\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n adsByAdManagerAccountIds(ids: $ids, input: $adsInput) {\n ads {\n id\n name\n status\n effectiveStatus\n productLink\n copy\n headline\n mediaUrl\n storeId\n adPlatformAccountId\n sourceAdManagerAccountId\n sourceCampaignId\n sourceAdsetId\n sourceAdId\n adManagerAccountId\n campaignId\n adsetId\n spend\n orders\n ordersValue\n sourceOrders\n sourceOrdersValue\n createdAt\n updatedAt\n sourceCreatedAt\n }\n aggregates {\n orders\n ordersValue\n spend\n sourceOrders\n sourceOrdersValue\n }\n totals {\n orders {\n total\n attributed\n facebook\n organic\n }\n revenue {\n total\n attributed\n facebook\n organic\n }\n spend\n dailyBudget\n }\n total\n }\n}\n `;\n\n/**\n * __useAdsetsAdsByAdManagerAccountIdsQuery__\n *\n * To run a query within a React component, call `useAdsetsAdsByAdManagerAccountIdsQuery` and pass it any options that fit your needs.\n * When your component renders, `useAdsetsAdsByAdManagerAccountIdsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useAdsetsAdsByAdManagerAccountIdsQuery({\n * variables: {\n * ids: // value for 'ids'\n * adsetsInput: // value for 'adsetsInput'\n * adsInput: // value for 'adsInput'\n * },\n * });\n */\nexport function useAdsetsAdsByAdManagerAccountIdsQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(AdsetsAdsByAdManagerAccountIdsDocument, options);\n }\nexport function useAdsetsAdsByAdManagerAccountIdsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(AdsetsAdsByAdManagerAccountIdsDocument, options);\n }\nexport type AdsetsAdsByAdManagerAccountIdsQueryHookResult = ReturnType;\nexport type AdsetsAdsByAdManagerAccountIdsLazyQueryHookResult = ReturnType;\nexport type AdsetsAdsByAdManagerAccountIdsQueryResult = Apollo.QueryResult;\nexport const ShopifyInstallUrlDocument = gql`\n query ShopifyInstallUrl {\n shopifyInstallUrl\n}\n `;\n\n/**\n * __useShopifyInstallUrlQuery__\n *\n * To run a query within a React component, call `useShopifyInstallUrlQuery` and pass it any options that fit your needs.\n * When your component renders, `useShopifyInstallUrlQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useShopifyInstallUrlQuery({\n * variables: {\n * },\n * });\n */\nexport function useShopifyInstallUrlQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(ShopifyInstallUrlDocument, options);\n }\nexport function useShopifyInstallUrlLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(ShopifyInstallUrlDocument, options);\n }\nexport type ShopifyInstallUrlQueryHookResult = ReturnType;\nexport type ShopifyInstallUrlLazyQueryHookResult = ReturnType;\nexport type ShopifyInstallUrlQueryResult = Apollo.QueryResult;\nexport const SubscriptionLinkDocument = gql`\n mutation SubscriptionLink($id: ID!, $input: CreateCheckoutSessionInput!) {\n createCheckoutSessionByStoreId(id: $id, input: $input) {\n ... on CheckoutSession {\n sessionUrl\n }\n ... on SubscriptionAlreadyCreated {\n message\n subscriptionPlan {\n id\n organizationId\n subscriptionId\n planId\n currentPeriodStart\n currentPeriodEnd\n storeId\n status\n createdAt\n updatedAt\n canceledAt\n }\n }\n ... on UnableToCreateCheckoutSession {\n error\n }\n }\n}\n `;\nexport type SubscriptionLinkMutationFn = Apollo.MutationFunction;\n\n/**\n * __useSubscriptionLinkMutation__\n *\n * To run a mutation, you first call `useSubscriptionLinkMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useSubscriptionLinkMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [subscriptionLinkMutation, { data, loading, error }] = useSubscriptionLinkMutation({\n * variables: {\n * id: // value for 'id'\n * input: // value for 'input'\n * },\n * });\n */\nexport function useSubscriptionLinkMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(SubscriptionLinkDocument, options);\n }\nexport type SubscriptionLinkMutationHookResult = ReturnType;\nexport type SubscriptionLinkMutationResult = Apollo.MutationResult;\nexport type SubscriptionLinkMutationOptions = Apollo.BaseMutationOptions;\nexport const CreateBillingPortalByStoreIdDocument = gql`\n mutation CreateBillingPortalByStoreId($id: ID!, $input: CreateBillingPortalInput!) {\n createBillingPortalByStoreId(id: $id, input: $input) {\n ... on Error {\n error\n }\n ... on BillingPortal {\n sessionUrl\n }\n }\n}\n `;\nexport type CreateBillingPortalByStoreIdMutationFn = Apollo.MutationFunction;\n\n/**\n * __useCreateBillingPortalByStoreIdMutation__\n *\n * To run a mutation, you first call `useCreateBillingPortalByStoreIdMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateBillingPortalByStoreIdMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createBillingPortalByStoreIdMutation, { data, loading, error }] = useCreateBillingPortalByStoreIdMutation({\n * variables: {\n * id: // value for 'id'\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateBillingPortalByStoreIdMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(CreateBillingPortalByStoreIdDocument, options);\n }\nexport type CreateBillingPortalByStoreIdMutationHookResult = ReturnType;\nexport type CreateBillingPortalByStoreIdMutationResult = Apollo.MutationResult;\nexport type CreateBillingPortalByStoreIdMutationOptions = Apollo.BaseMutationOptions;\nexport const SubscriptionPlanByStoreIdDocument = gql`\n query SubscriptionPlanByStoreId($storeId: ID!) {\n subscriptionPlanByStoreId(id: $storeId) {\n ... on SubscriptionPlan {\n id\n organizationId\n subscriptionId\n planId\n currentPeriodStart\n currentPeriodEnd\n storeId\n isYearly\n status\n createdAt\n updatedAt\n canceledAt\n }\n ... on Error {\n error\n }\n }\n}\n `;\n\n/**\n * __useSubscriptionPlanByStoreIdQuery__\n *\n * To run a query within a React component, call `useSubscriptionPlanByStoreIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useSubscriptionPlanByStoreIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useSubscriptionPlanByStoreIdQuery({\n * variables: {\n * storeId: // value for 'storeId'\n * },\n * });\n */\nexport function useSubscriptionPlanByStoreIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(SubscriptionPlanByStoreIdDocument, options);\n }\nexport function useSubscriptionPlanByStoreIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(SubscriptionPlanByStoreIdDocument, options);\n }\nexport type SubscriptionPlanByStoreIdQueryHookResult = ReturnType;\nexport type SubscriptionPlanByStoreIdLazyQueryHookResult = ReturnType;\nexport type SubscriptionPlanByStoreIdQueryResult = Apollo.QueryResult;","import React from 'react'\nimport { DecodedToken } from '../providers/jwtProvider'\n\nexport const JwtContext = React.createContext(null)\n","/** @private */\nexport function extendedTypeof(val) {\n if (val === null) {\n return 'null';\n }\n if (Array.isArray(val)) {\n return 'array';\n }\n return typeof val;\n}\n/** @private */\nexport function isObject(val) {\n return extendedTypeof(val) === 'object';\n}\n/** @private */\nexport function isAsyncIterable(val) {\n return typeof Object(val)[Symbol.asyncIterator] === 'function';\n}\n/** @private */\nexport function isAsyncGenerator(val) {\n return (isObject(val) &&\n typeof Object(val)[Symbol.asyncIterator] === 'function' &&\n typeof val.return === 'function'\n // for lazy ones, we only need the return anyway\n // typeof val.throw === 'function' &&\n // typeof val.next === 'function'\n );\n}\n/** @private */\nexport function areGraphQLErrors(obj) {\n return (Array.isArray(obj) &&\n // must be at least one error\n obj.length > 0 &&\n // error has at least a message\n obj.every((ob) => 'message' in ob));\n}\n/**\n * Limits the WebSocket close event reason to not exceed a length of one frame.\n * Reference: https://datatracker.ietf.org/doc/html/rfc6455#section-5.2.\n *\n * @private\n */\nexport function limitCloseReason(reason, whenTooLong) {\n return reason.length < 124 ? reason : whenTooLong;\n}\n","/**\n *\n * common\n *\n */\nimport { areGraphQLErrors, extendedTypeof, isObject } from './utils.mjs';\n/**\n * The WebSocket sub-protocol used for the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md).\n *\n * @category Common\n */\nexport const GRAPHQL_TRANSPORT_WS_PROTOCOL = 'graphql-transport-ws';\n/**\n * The deprecated subprotocol used by [subscriptions-transport-ws](https://github.com/apollographql/subscriptions-transport-ws).\n *\n * @private\n */\nexport const DEPRECATED_GRAPHQL_WS_PROTOCOL = 'graphql-ws';\n/**\n * `graphql-ws` expected and standard close codes of the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md).\n *\n * @category Common\n */\nexport var CloseCode;\n(function (CloseCode) {\n CloseCode[CloseCode[\"InternalServerError\"] = 4500] = \"InternalServerError\";\n CloseCode[CloseCode[\"InternalClientError\"] = 4005] = \"InternalClientError\";\n CloseCode[CloseCode[\"BadRequest\"] = 4400] = \"BadRequest\";\n CloseCode[CloseCode[\"BadResponse\"] = 4004] = \"BadResponse\";\n /** Tried subscribing before connect ack */\n CloseCode[CloseCode[\"Unauthorized\"] = 4401] = \"Unauthorized\";\n CloseCode[CloseCode[\"Forbidden\"] = 4403] = \"Forbidden\";\n CloseCode[CloseCode[\"SubprotocolNotAcceptable\"] = 4406] = \"SubprotocolNotAcceptable\";\n CloseCode[CloseCode[\"ConnectionInitialisationTimeout\"] = 4408] = \"ConnectionInitialisationTimeout\";\n CloseCode[CloseCode[\"ConnectionAcknowledgementTimeout\"] = 4504] = \"ConnectionAcknowledgementTimeout\";\n /** Subscriber distinction is very important */\n CloseCode[CloseCode[\"SubscriberAlreadyExists\"] = 4409] = \"SubscriberAlreadyExists\";\n CloseCode[CloseCode[\"TooManyInitialisationRequests\"] = 4429] = \"TooManyInitialisationRequests\";\n})(CloseCode || (CloseCode = {}));\n/**\n * Types of messages allowed to be sent by the client/server over the WS protocol.\n *\n * @category Common\n */\nexport var MessageType;\n(function (MessageType) {\n MessageType[\"ConnectionInit\"] = \"connection_init\";\n MessageType[\"ConnectionAck\"] = \"connection_ack\";\n MessageType[\"Ping\"] = \"ping\";\n MessageType[\"Pong\"] = \"pong\";\n MessageType[\"Subscribe\"] = \"subscribe\";\n MessageType[\"Next\"] = \"next\";\n MessageType[\"Error\"] = \"error\";\n MessageType[\"Complete\"] = \"complete\";\n})(MessageType || (MessageType = {}));\n/**\n * Validates the message against the GraphQL over WebSocket Protocol.\n *\n * Invalid messages will throw descriptive errors.\n *\n * @category Common\n */\nexport function validateMessage(val) {\n if (!isObject(val)) {\n throw new Error(`Message is expected to be an object, but got ${extendedTypeof(val)}`);\n }\n if (!val.type) {\n throw new Error(`Message is missing the 'type' property`);\n }\n if (typeof val.type !== 'string') {\n throw new Error(`Message is expects the 'type' property to be a string, but got ${extendedTypeof(val.type)}`);\n }\n switch (val.type) {\n case MessageType.ConnectionInit:\n case MessageType.ConnectionAck:\n case MessageType.Ping:\n case MessageType.Pong: {\n if (val.payload != null && !isObject(val.payload)) {\n throw new Error(`\"${val.type}\" message expects the 'payload' property to be an object or nullish or missing, but got \"${val.payload}\"`);\n }\n break;\n }\n case MessageType.Subscribe: {\n if (typeof val.id !== 'string') {\n throw new Error(`\"${val.type}\" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);\n }\n if (!val.id) {\n throw new Error(`\"${val.type}\" message requires a non-empty 'id' property`);\n }\n if (!isObject(val.payload)) {\n throw new Error(`\"${val.type}\" message expects the 'payload' property to be an object, but got ${extendedTypeof(val.payload)}`);\n }\n if (typeof val.payload.query !== 'string') {\n throw new Error(`\"${val.type}\" message payload expects the 'query' property to be a string, but got ${extendedTypeof(val.payload.query)}`);\n }\n if (val.payload.variables != null && !isObject(val.payload.variables)) {\n throw new Error(`\"${val.type}\" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${extendedTypeof(val.payload.variables)}`);\n }\n if (val.payload.operationName != null &&\n extendedTypeof(val.payload.operationName) !== 'string') {\n throw new Error(`\"${val.type}\" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${extendedTypeof(val.payload.operationName)}`);\n }\n if (val.payload.extensions != null && !isObject(val.payload.extensions)) {\n throw new Error(`\"${val.type}\" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${extendedTypeof(val.payload.extensions)}`);\n }\n break;\n }\n case MessageType.Next: {\n if (typeof val.id !== 'string') {\n throw new Error(`\"${val.type}\" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);\n }\n if (!val.id) {\n throw new Error(`\"${val.type}\" message requires a non-empty 'id' property`);\n }\n if (!isObject(val.payload)) {\n throw new Error(`\"${val.type}\" message expects the 'payload' property to be an object, but got ${extendedTypeof(val.payload)}`);\n }\n break;\n }\n case MessageType.Error: {\n if (typeof val.id !== 'string') {\n throw new Error(`\"${val.type}\" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);\n }\n if (!val.id) {\n throw new Error(`\"${val.type}\" message requires a non-empty 'id' property`);\n }\n if (!areGraphQLErrors(val.payload)) {\n throw new Error(`\"${val.type}\" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(val.payload)}`);\n }\n break;\n }\n case MessageType.Complete: {\n if (typeof val.id !== 'string') {\n throw new Error(`\"${val.type}\" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);\n }\n if (!val.id) {\n throw new Error(`\"${val.type}\" message requires a non-empty 'id' property`);\n }\n break;\n }\n default:\n throw new Error(`Invalid message 'type' property \"${val.type}\"`);\n }\n return val;\n}\n/**\n * Checks if the provided value is a valid GraphQL over WebSocket message.\n *\n * @deprecated Use `validateMessage` instead.\n *\n * @category Common\n */\nexport function isMessage(val) {\n try {\n validateMessage(val);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n/**\n * Parses the raw websocket message data to a valid message.\n *\n * @category Common\n */\nexport function parseMessage(data, reviver) {\n return validateMessage(typeof data === 'string' ? JSON.parse(data, reviver) : data);\n}\n/**\n * Stringifies a valid message ready to be sent through the socket.\n *\n * @category Common\n */\nexport function stringifyMessage(msg, replacer) {\n validateMessage(msg);\n return JSON.stringify(msg, replacer);\n}\n","/**\n *\n * client\n *\n */\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport { GRAPHQL_TRANSPORT_WS_PROTOCOL, CloseCode, MessageType, parseMessage, stringifyMessage, } from './common.mjs';\nimport { isObject, limitCloseReason } from './utils.mjs';\n/** This file is the entry point for browsers, re-export common elements. */\nexport * from './common.mjs';\n/**\n * Creates a disposable GraphQL over WebSocket client.\n *\n * @category Client\n */\nexport function createClient(options) {\n const { url, connectionParams, lazy = true, onNonLazyError = console.error, lazyCloseTimeout: lazyCloseTimeoutMs = 0, keepAlive = 0, disablePong, connectionAckWaitTimeout = 0, retryAttempts = 5, retryWait = async function randomisedExponentialBackoff(retries) {\n let retryDelay = 1000; // start with 1s delay\n for (let i = 0; i < retries; i++) {\n retryDelay *= 2;\n }\n await new Promise((resolve) => setTimeout(resolve, retryDelay +\n // add random timeout from 300ms to 3s\n Math.floor(Math.random() * (3000 - 300) + 300)));\n }, shouldRetry = isLikeCloseEvent, isFatalConnectionProblem, on, webSocketImpl, \n /**\n * Generates a v4 UUID to be used as the ID using `Math`\n * as the random number generator. Supply your own generator\n * in case you need more uniqueness.\n *\n * Reference: https://gist.github.com/jed/982883\n */\n generateID = function generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }, jsonMessageReplacer: replacer, jsonMessageReviver: reviver, } = options;\n let ws;\n if (webSocketImpl) {\n if (!isWebSocket(webSocketImpl)) {\n throw new Error('Invalid WebSocket implementation provided');\n }\n ws = webSocketImpl;\n }\n else if (typeof WebSocket !== 'undefined') {\n ws = WebSocket;\n }\n else if (typeof global !== 'undefined') {\n ws =\n global.WebSocket ||\n // @ts-expect-error: Support more browsers\n global.MozWebSocket;\n }\n else if (typeof window !== 'undefined') {\n ws =\n window.WebSocket ||\n // @ts-expect-error: Support more browsers\n window.MozWebSocket;\n }\n if (!ws)\n throw new Error(\"WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`\");\n const WebSocketImpl = ws;\n // websocket status emitter, subscriptions are handled differently\n const emitter = (() => {\n const message = (() => {\n const listeners = {};\n return {\n on(id, listener) {\n listeners[id] = listener;\n return () => {\n delete listeners[id];\n };\n },\n emit(message) {\n var _a;\n if ('id' in message)\n (_a = listeners[message.id]) === null || _a === void 0 ? void 0 : _a.call(listeners, message);\n },\n };\n })();\n const listeners = {\n connecting: (on === null || on === void 0 ? void 0 : on.connecting) ? [on.connecting] : [],\n opened: (on === null || on === void 0 ? void 0 : on.opened) ? [on.opened] : [],\n connected: (on === null || on === void 0 ? void 0 : on.connected) ? [on.connected] : [],\n ping: (on === null || on === void 0 ? void 0 : on.ping) ? [on.ping] : [],\n pong: (on === null || on === void 0 ? void 0 : on.pong) ? [on.pong] : [],\n message: (on === null || on === void 0 ? void 0 : on.message) ? [message.emit, on.message] : [message.emit],\n closed: (on === null || on === void 0 ? void 0 : on.closed) ? [on.closed] : [],\n error: (on === null || on === void 0 ? void 0 : on.error) ? [on.error] : [],\n };\n return {\n onMessage: message.on,\n on(event, listener) {\n const l = listeners[event];\n l.push(listener);\n return () => {\n l.splice(l.indexOf(listener), 1);\n };\n },\n emit(event, ...args) {\n // we copy the listeners so that unlistens dont \"pull the rug under our feet\"\n for (const listener of [...listeners[event]]) {\n // @ts-expect-error: The args should fit\n listener(...args);\n }\n },\n };\n })();\n // invokes the callback either when an error or closed event is emitted,\n // first one that gets called prevails, other emissions are ignored\n function errorOrClosed(cb) {\n const listening = [\n // errors are fatal and more critical than close events, throw them first\n emitter.on('error', (err) => {\n listening.forEach((unlisten) => unlisten());\n cb(err);\n }),\n // closes can be graceful and not fatal, throw them second (if error didnt throw)\n emitter.on('closed', (event) => {\n listening.forEach((unlisten) => unlisten());\n cb(event);\n }),\n ];\n }\n let connecting, locks = 0, lazyCloseTimeout, retrying = false, retries = 0, disposed = false;\n async function connect() {\n // clear the lazy close timeout immediatelly so that close gets debounced\n // see: https://github.com/enisdenjo/graphql-ws/issues/388\n clearTimeout(lazyCloseTimeout);\n const [socket, throwOnClose] = await (connecting !== null && connecting !== void 0 ? connecting : (connecting = new Promise((connected, denied) => (async () => {\n if (retrying) {\n await retryWait(retries);\n // subscriptions might complete while waiting for retry\n if (!locks) {\n connecting = undefined;\n return denied({ code: 1000, reason: 'All Subscriptions Gone' });\n }\n retries++;\n }\n emitter.emit('connecting');\n const socket = new WebSocketImpl(typeof url === 'function' ? await url() : url, GRAPHQL_TRANSPORT_WS_PROTOCOL);\n let connectionAckTimeout, queuedPing;\n function enqueuePing() {\n if (isFinite(keepAlive) && keepAlive > 0) {\n clearTimeout(queuedPing); // in case where a pong was received before a ping (this is valid behaviour)\n queuedPing = setTimeout(() => {\n if (socket.readyState === WebSocketImpl.OPEN) {\n socket.send(stringifyMessage({ type: MessageType.Ping }));\n emitter.emit('ping', false, undefined);\n }\n }, keepAlive);\n }\n }\n errorOrClosed((errOrEvent) => {\n connecting = undefined;\n clearTimeout(connectionAckTimeout);\n clearTimeout(queuedPing);\n denied(errOrEvent);\n if (isLikeCloseEvent(errOrEvent) && errOrEvent.code === 4499) {\n socket.close(4499, 'Terminated'); // close event is artificial and emitted manually, see `Client.terminate()` below\n socket.onerror = null;\n socket.onclose = null;\n }\n });\n socket.onerror = (err) => emitter.emit('error', err);\n socket.onclose = (event) => emitter.emit('closed', event);\n socket.onopen = async () => {\n try {\n emitter.emit('opened', socket);\n const payload = typeof connectionParams === 'function'\n ? await connectionParams()\n : connectionParams;\n // connectionParams might take too long causing the server to kick off the client\n // the necessary error/close event is already reported - simply stop execution\n if (socket.readyState !== WebSocketImpl.OPEN)\n return;\n socket.send(stringifyMessage(payload\n ? {\n type: MessageType.ConnectionInit,\n payload,\n }\n : {\n type: MessageType.ConnectionInit,\n // payload is completely absent if not provided\n }, replacer));\n if (isFinite(connectionAckWaitTimeout) &&\n connectionAckWaitTimeout > 0) {\n connectionAckTimeout = setTimeout(() => {\n socket.close(CloseCode.ConnectionAcknowledgementTimeout, 'Connection acknowledgement timeout');\n }, connectionAckWaitTimeout);\n }\n enqueuePing(); // enqueue ping (noop if disabled)\n }\n catch (err) {\n emitter.emit('error', err);\n socket.close(CloseCode.InternalClientError, limitCloseReason(err instanceof Error ? err.message : new Error(err).message, 'Internal client error'));\n }\n };\n let acknowledged = false;\n socket.onmessage = ({ data }) => {\n try {\n const message = parseMessage(data, reviver);\n emitter.emit('message', message);\n if (message.type === 'ping' || message.type === 'pong') {\n emitter.emit(message.type, true, message.payload); // received\n if (message.type === 'pong') {\n enqueuePing(); // enqueue next ping (noop if disabled)\n }\n else if (!disablePong) {\n // respond with pong on ping\n socket.send(stringifyMessage(message.payload\n ? {\n type: MessageType.Pong,\n payload: message.payload,\n }\n : {\n type: MessageType.Pong,\n // payload is completely absent if not provided\n }));\n emitter.emit('pong', false, message.payload);\n }\n return; // ping and pongs can be received whenever\n }\n if (acknowledged)\n return; // already connected and acknowledged\n if (message.type !== MessageType.ConnectionAck)\n throw new Error(`First message cannot be of type ${message.type}`);\n clearTimeout(connectionAckTimeout);\n acknowledged = true;\n emitter.emit('connected', socket, message.payload); // connected = socket opened + acknowledged\n retrying = false; // future lazy connects are not retries\n retries = 0; // reset the retries on connect\n connected([\n socket,\n new Promise((_, reject) => errorOrClosed(reject)),\n ]);\n }\n catch (err) {\n socket.onmessage = null; // stop reading messages as soon as reading breaks once\n emitter.emit('error', err);\n socket.close(CloseCode.BadResponse, limitCloseReason(err instanceof Error ? err.message : new Error(err).message, 'Bad response'));\n }\n };\n })())));\n // if the provided socket is in a closing state, wait for the throw on close\n if (socket.readyState === WebSocketImpl.CLOSING)\n await throwOnClose;\n let release = () => {\n // releases this connection\n };\n const released = new Promise((resolve) => (release = resolve));\n return [\n socket,\n release,\n Promise.race([\n // wait for\n released.then(() => {\n if (!locks) {\n // and if no more locks are present, complete the connection\n const complete = () => socket.close(1000, 'Normal Closure');\n if (isFinite(lazyCloseTimeoutMs) && lazyCloseTimeoutMs > 0) {\n // if the keepalive is set, allow for the specified calmdown time and\n // then complete if the socket is still open.\n lazyCloseTimeout = setTimeout(() => {\n if (socket.readyState === WebSocketImpl.OPEN)\n complete();\n }, lazyCloseTimeoutMs);\n }\n else {\n // otherwise complete immediately\n complete();\n }\n }\n }),\n // or\n throwOnClose,\n ]),\n ];\n }\n /**\n * Checks the `connect` problem and evaluates if the client should retry.\n */\n function shouldRetryConnectOrThrow(errOrCloseEvent) {\n // some close codes are worth reporting immediately\n if (isLikeCloseEvent(errOrCloseEvent) &&\n (isFatalInternalCloseCode(errOrCloseEvent.code) ||\n [\n CloseCode.InternalServerError,\n CloseCode.InternalClientError,\n CloseCode.BadRequest,\n CloseCode.BadResponse,\n CloseCode.Unauthorized,\n // CloseCode.Forbidden, might grant access out after retry\n CloseCode.SubprotocolNotAcceptable,\n // CloseCode.ConnectionInitialisationTimeout, might not time out after retry\n // CloseCode.ConnectionAcknowledgementTimeout, might not time out after retry\n CloseCode.SubscriberAlreadyExists,\n CloseCode.TooManyInitialisationRequests,\n // 4499, // Terminated, probably because the socket froze, we want to retry\n ].includes(errOrCloseEvent.code)))\n throw errOrCloseEvent;\n // client was disposed, no retries should proceed regardless\n if (disposed)\n return false;\n // normal closure (possibly all subscriptions have completed)\n // if no locks were acquired in the meantime, shouldnt try again\n if (isLikeCloseEvent(errOrCloseEvent) && errOrCloseEvent.code === 1000)\n return locks > 0;\n // retries are not allowed or we tried to many times, report error\n if (!retryAttempts || retries >= retryAttempts)\n throw errOrCloseEvent;\n // throw non-retryable connection problems\n if (!shouldRetry(errOrCloseEvent))\n throw errOrCloseEvent;\n // @deprecated throw fatal connection problems immediately\n if (isFatalConnectionProblem === null || isFatalConnectionProblem === void 0 ? void 0 : isFatalConnectionProblem(errOrCloseEvent))\n throw errOrCloseEvent;\n // looks good, start retrying\n return (retrying = true);\n }\n // in non-lazy (hot?) mode always hold one connection lock to persist the socket\n if (!lazy) {\n (async () => {\n locks++;\n for (;;) {\n try {\n const [, , throwOnClose] = await connect();\n await throwOnClose; // will always throw because releaser is not used\n }\n catch (errOrCloseEvent) {\n try {\n if (!shouldRetryConnectOrThrow(errOrCloseEvent))\n return;\n }\n catch (errOrCloseEvent) {\n // report thrown error, no further retries\n return onNonLazyError === null || onNonLazyError === void 0 ? void 0 : onNonLazyError(errOrCloseEvent);\n }\n }\n }\n })();\n }\n return {\n on: emitter.on,\n subscribe(payload, sink) {\n const id = generateID(payload);\n let done = false, errored = false, releaser = () => {\n // for handling completions before connect\n locks--;\n done = true;\n };\n (async () => {\n locks++;\n for (;;) {\n try {\n const [socket, release, waitForReleaseOrThrowOnClose] = await connect();\n // if done while waiting for connect, release the connection lock right away\n if (done)\n return release();\n const unlisten = emitter.onMessage(id, (message) => {\n switch (message.type) {\n case MessageType.Next: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- payload will fit type\n sink.next(message.payload);\n return;\n }\n case MessageType.Error: {\n (errored = true), (done = true);\n sink.error(message.payload);\n releaser();\n return;\n }\n case MessageType.Complete: {\n done = true;\n releaser(); // release completes the sink\n return;\n }\n }\n });\n socket.send(stringifyMessage({\n id,\n type: MessageType.Subscribe,\n payload,\n }, replacer));\n releaser = () => {\n if (!done && socket.readyState === WebSocketImpl.OPEN)\n // if not completed already and socket is open, send complete message to server on release\n socket.send(stringifyMessage({\n id,\n type: MessageType.Complete,\n }, replacer));\n locks--;\n done = true;\n release();\n };\n // either the releaser will be called, connection completed and\n // the promise resolved or the socket closed and the promise rejected.\n // whatever happens though, we want to stop listening for messages\n await waitForReleaseOrThrowOnClose.finally(unlisten);\n return; // completed, shouldnt try again\n }\n catch (errOrCloseEvent) {\n if (!shouldRetryConnectOrThrow(errOrCloseEvent))\n return;\n }\n }\n })()\n .then(() => {\n // delivering either an error or a complete terminates the sequence\n if (!errored)\n sink.complete();\n }) // resolves on release or normal closure\n .catch((err) => {\n sink.error(err);\n }); // rejects on close events and errors\n return () => {\n // dispose only of active subscriptions\n if (!done)\n releaser();\n };\n },\n iterate(request) {\n const pending = [];\n const deferred = {\n done: false,\n error: null,\n resolve: () => {\n // noop\n },\n };\n const dispose = this.subscribe(request, {\n next(val) {\n pending.push(val);\n deferred.resolve();\n },\n error(err) {\n deferred.done = true;\n deferred.error = err;\n deferred.resolve();\n },\n complete() {\n deferred.done = true;\n deferred.resolve();\n },\n });\n const iterator = (function iterator() {\n return __asyncGenerator(this, arguments, function* iterator_1() {\n for (;;) {\n if (!pending.length) {\n // only wait if there are no pending messages available\n yield __await(new Promise((resolve) => (deferred.resolve = resolve)));\n }\n // first flush\n while (pending.length) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n yield yield __await(pending.shift());\n }\n // then error\n if (deferred.error) {\n throw deferred.error;\n }\n // or complete\n if (deferred.done) {\n return yield __await(void 0);\n }\n }\n });\n })();\n iterator.throw = async (err) => {\n if (!deferred.done) {\n deferred.done = true;\n deferred.error = err;\n deferred.resolve();\n }\n return { done: true, value: undefined };\n };\n iterator.return = async () => {\n dispose();\n return { done: true, value: undefined };\n };\n return iterator;\n },\n async dispose() {\n disposed = true;\n if (connecting) {\n // if there is a connection, close it\n const [socket] = await connecting;\n socket.close(1000, 'Normal Closure');\n }\n },\n terminate() {\n if (connecting) {\n // only if there is a connection\n emitter.emit('closed', {\n code: 4499,\n reason: 'Terminated',\n wasClean: false,\n });\n }\n },\n };\n}\nfunction isLikeCloseEvent(val) {\n return isObject(val) && 'code' in val && 'reason' in val;\n}\nfunction isFatalInternalCloseCode(code) {\n if ([\n 1000,\n 1001,\n 1006,\n 1005,\n 1012,\n 1013,\n 1014, // Bad Gateway\n ].includes(code))\n return false;\n // all other internal errors are fatal\n return code >= 1000 && code <= 1999;\n}\nfunction isWebSocket(val) {\n return (typeof val === 'function' &&\n 'constructor' in val &&\n 'CLOSED' in val &&\n 'CLOSING' in val &&\n 'CONNECTING' in val &&\n 'OPEN' in val);\n}\n","import { __rest } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nexport function setContext(setter) {\n return new ApolloLink(function (operation, forward) {\n var request = __rest(operation, []);\n return new Observable(function (observer) {\n var handle;\n var closed = false;\n Promise.resolve(request)\n .then(function (req) { return setter(req, operation.getContext()); })\n .then(operation.setContext)\n .then(function () {\n if (closed)\n return;\n handle = forward(operation).subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n })\n .catch(observer.error.bind(observer));\n return function () {\n closed = true;\n if (handle)\n handle.unsubscribe();\n };\n });\n });\n}\n//# sourceMappingURL=index.js.map","import { __assign, __extends } from \"tslib\";\nimport { print } from \"graphql\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { isNonNullObject, Observable } from \"../../utilities/index.js\";\nimport { ApolloError } from \"../../errors/index.js\";\nfunction isLikeCloseEvent(val) {\n return isNonNullObject(val) && \"code\" in val && \"reason\" in val;\n}\nfunction isLikeErrorEvent(err) {\n var _a;\n return isNonNullObject(err) && ((_a = err.target) === null || _a === void 0 ? void 0 : _a.readyState) === WebSocket.CLOSED;\n}\nvar GraphQLWsLink = (function (_super) {\n __extends(GraphQLWsLink, _super);\n function GraphQLWsLink(client) {\n var _this = _super.call(this) || this;\n _this.client = client;\n return _this;\n }\n GraphQLWsLink.prototype.request = function (operation) {\n var _this = this;\n return new Observable(function (observer) {\n return _this.client.subscribe(__assign(__assign({}, operation), { query: print(operation.query) }), {\n next: observer.next.bind(observer),\n complete: observer.complete.bind(observer),\n error: function (err) {\n if (err instanceof Error) {\n return observer.error(err);\n }\n var likeClose = isLikeCloseEvent(err);\n if (likeClose || isLikeErrorEvent(err)) {\n return observer.error(new Error(\"Socket closed\".concat(likeClose ? \" with event \".concat(err.code) : \"\").concat(likeClose ? \" \".concat(err.reason) : \"\")));\n }\n return observer.error(new ApolloError({\n graphQLErrors: Array.isArray(err) ? err : [err],\n }));\n },\n });\n });\n };\n return GraphQLWsLink;\n}(ApolloLink));\nexport { GraphQLWsLink };\n//# sourceMappingURL=index.js.map","function e(e){this.message=e}e.prototype=new Error,e.prototype.name=\"InvalidCharacterError\";var r=\"undefined\"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,\"\");if(t.length%4==1)throw new e(\"'atob' failed: The string to be decoded is not correctly encoded.\");for(var n,o,a=0,i=0,c=\"\";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(o);return c};function t(e){var t=e.replace(/-/g,\"+\").replace(/_/g,\"/\");switch(t.length%4){case 0:break;case 2:t+=\"==\";break;case 3:t+=\"=\";break;default:throw\"Illegal base64url string!\"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t=\"0\"+t),\"%\"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if(\"string\"!=typeof e)throw new n(\"Invalid token specified\");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(\".\")[o]))}catch(e){throw new n(\"Invalid token specified: \"+e.message)}}n.prototype=new Error,n.prototype.name=\"InvalidTokenError\";export default o;export{n as InvalidTokenError};\n//# sourceMappingURL=jwt-decode.esm.js.map\n","export enum LocalStorageKeys {\n Email = 'loginEmail',\n RememberMe = 'loginRememberMe',\n AuthToken = 'authToken',\n CodeEmail = 'codeEmail',\n CodePhone = 'codePhone',\n CodeChannel = 'codeChannel',\n CodeSentAt = 'codeSentAt',\n CodeExpiresAt = 'codeExpiresAt',\n PersistedState = 'persistedState',\n SiderCollapse = 'siderCollapse',\n Timezone = 'timezone',\n IsMobile = 'isMobile',\n AppVersion = 'appVersion',\n}\n\nexport enum LocalStorageTypes {\n String = 'string',\n Boolean = 'boolean',\n Number = 'number',\n Json = 'json',\n}\n","import { LocalStorageKeys } from '../common/types/localStorage'\nimport packageJson from '../../package.json'\n\nwindow.addEventListener('storage', (event) => {\n if (event.key && Object.values(LocalStorageKeys).includes(event.key as LocalStorageKeys)) {\n window.dispatchEvent(new Event(`storage:${event.key}`))\n }\n})\n\nexport const localStorageGetItem = (key: LocalStorageKeys) => {\n return localStorage.getItem(key)\n}\n\nexport const localStorageSetItem = (key: LocalStorageKeys, value: string) => {\n localStorage.setItem(key, value)\n window.dispatchEvent(new Event(`storage:${key}`))\n}\n\nexport const localStorageRemoveItem = (key: LocalStorageKeys) => {\n localStorage.removeItem(key)\n window.dispatchEvent(new Event(`storage:${key}`))\n}\n\nexport const localStorageAddListener = (key: LocalStorageKeys, callback: () => void) => {\n window.addEventListener(`storage:${key}`, callback)\n}\n\nexport const localStorageRemoveListener = (key: LocalStorageKeys, callback: () => void) => {\n window.removeEventListener(`storage:${key}`, callback)\n}\n\n/**\n * Clears all items in localStorage except for specified keys\n * @param keysToKeep Optional array of keys to preserve during clearing\n */\nexport const clearLocalStorage = (keysToKeep: LocalStorageKeys[] = []) => {\n // Get all keys from localStorage\n const allKeys = Object.values(LocalStorageKeys)\n\n // Filter out keys that should be kept\n const keysToRemove = allKeys.filter((key) => !keysToKeep.includes(key))\n\n // Remove each key\n keysToRemove.forEach((key) => {\n console.log('removing key', key)\n localStorageRemoveItem(key)\n })\n}\n\n/**\n * Checks if the current app version matches the stored version\n * If versions don't match, clears localStorage and updates the stored version\n * @returns boolean indicating whether cache was cleared\n */\nexport const checkAndUpdateVersion = (): boolean => {\n console.log('checkAndUpdateVersion', packageJson.version)\n const currentVersion = packageJson.version\n const storedVersion = localStorageGetItem(LocalStorageKeys.AppVersion)\n console.log('storedVersion', storedVersion)\n\n // If versions don't match or no stored version exists\n if (!storedVersion || storedVersion !== currentVersion) {\n // Clear localStorage\n clearLocalStorage()\n\n // Update stored version\n localStorageSetItem(LocalStorageKeys.AppVersion, currentVersion)\n\n return true\n }\n\n return false\n}\n","import jwtDecode, { JwtPayload } from 'jwt-decode'\nimport { LocalStorageKeys } from '../common/types/localStorage'\nimport { localStorageRemoveItem } from './storage'\n\nconst privateKeys = [\n LocalStorageKeys.AuthToken,\n LocalStorageKeys.PersistedState,\n LocalStorageKeys.Timezone,\n LocalStorageKeys.SiderCollapse,\n LocalStorageKeys.CodeEmail,\n LocalStorageKeys.CodePhone,\n LocalStorageKeys.CodeChannel,\n LocalStorageKeys.CodeSentAt,\n LocalStorageKeys.CodeExpiresAt,\n LocalStorageKeys.IsMobile,\n]\n\n// const publicKeys = [LocalStorageKeys.Email, LocalStorageKeys.RememberMe]\n\nexport const clearPrivateStorageLogout = () => {\n privateKeys.forEach((key) => localStorageRemoveItem(key))\n}\n\nexport const clearPrivateStorageLogin = () => {\n const keysToRemove = privateKeys.filter((key) => key !== LocalStorageKeys.AuthToken)\n keysToRemove.forEach((key) => localStorageRemoveItem(key))\n}\n\nexport interface Jwt extends JwtPayload {\n user: {\n id: string\n firstName: string\n lastName: string\n email: string\n role: string\n phone: string\n organizationId: string\n subscribed: boolean\n }\n stores: string[]\n scope: string\n}\n\nexport function decodeToken(token: string | null) {\n try {\n if (!token) return null\n return jwtDecode(token)\n } catch (error) {\n localStorageRemoveItem(LocalStorageKeys.AuthToken)\n return null\n }\n}\n","import { ApolloClient, InMemoryCache, createHttpLink, ApolloLink, split } from '@apollo/client'\nimport { createClient } from 'graphql-ws'\nimport { setContext } from '@apollo/client/link/context'\nimport { GraphQLWsLink } from '@apollo/client/link/subscriptions'\nimport { clearPrivateStorageLogout, decodeToken } from '../services/auth'\nimport { getMainDefinition } from '@apollo/client/utilities'\nimport { privateRoutes } from '../routes/privateRoutes'\nimport { LocalStorageKeys } from '../common/types/localStorage'\nimport { localStorageGetItem, localStorageSetItem } from '../services/storage'\n\nconst wsLink = new GraphQLWsLink(\n createClient({\n url: import.meta.env.VITE_GRAPHQL_WS_SERVER_URL,\n connectionParams: () => ({\n Authorization: localStorageGetItem(LocalStorageKeys.AuthToken),\n }),\n }),\n)\n\nconst httpLink = createHttpLink({\n uri: `${import.meta.env.VITE_BASE_SERVER_URL}/graphql`,\n credentials: 'same-origin',\n})\n\nconst authLink = setContext((_, { headers }) => {\n // get the authentication token from local storage if it exists\n const token = localStorageGetItem(LocalStorageKeys.AuthToken)\n\n // return the headers to the context so httpLink can read them\n return {\n headers: {\n ...headers,\n authorization: token ? `Bearer ${token}` : '',\n },\n credentials: 'include',\n }\n})\n\n// our custom \"afterware\" that checks each response and saves the sessionID\n// if it contains an 'Authorization' header\nconst afterwareLink = new ApolloLink((operation, forward) => {\n return forward(operation).map((response) => {\n const context = operation.getContext()\n const newToken = context.response.headers.get('Authorization')?.replace('Bearer ', '')\n const currentToken = localStorageGetItem(LocalStorageKeys.AuthToken)\n\n const hasErrors = (response?.errors?.length ?? 0) > 0\n const isUnauthorized = response?.errors?.some((err) => err?.message.toLowerCase() === 'not authorised!')\n const isTokenInvalid = !newToken || (decodeToken(newToken)?.exp ?? 0) * 1000 < Date.now()\n const isPrivateRoute = privateRoutes.some((route) => window.location.pathname === route.path)\n\n if (hasErrors && isUnauthorized && isTokenInvalid && isPrivateRoute) {\n clearPrivateStorageLogout()\n window.location.href = '/login'\n } else if (newToken && newToken !== currentToken) {\n localStorageSetItem(LocalStorageKeys.AuthToken, newToken)\n }\n return response\n })\n})\n\nconst splitLink = split(\n ({ query }) => {\n const definition = getMainDefinition(query)\n return definition.kind === 'OperationDefinition' && definition.operation === 'subscription'\n },\n wsLink,\n authLink.concat(afterwareLink.concat(httpLink)),\n)\n\nexport const client = new ApolloClient({\n link: splitLink,\n cache: new InMemoryCache(),\n})\n","import { LogoutOutlined, UserOutlined } from '@ant-design/icons'\nimport { Avatar, Button, Dropdown, MenuProps } from 'antd'\nimport styled from 'styled-components'\nimport { colorTextSecondary } from '../../../theme/colors'\nimport { Link, useNavigate } from 'react-router-dom'\nimport { Routes } from '../../../Routes'\nimport { useLogoutMutation } from '../../../__generated__/graphql'\nimport { useContext, useEffect, useState } from 'react'\nimport { JwtContext } from '../../../contexts/jwtContext'\nimport { client } from '../../../graphql/client'\nimport { clearPrivateStorageLogout } from '../../../services/auth'\n\nconst MenuButton = styled(Button)`\n font-size: 14px;\n font-weight: 600;\n padding-left: 0;\n color: ${colorTextSecondary};\n`\n\nconst getMenuItems = (hideProfile: boolean): MenuProps['items'] => [\n ...(hideProfile ? [] : [{\n key: 'profile',\n icon: ,\n label: Profile,\n }]),\n {\n key: 'logout',\n icon: ,\n label: 'Logout',\n danger: true,\n },\n]\n\nconst logoutActions = () => {\n clearPrivateStorageLogout()\n client.resetStore()\n}\n\ninterface ProfileActionProps {\n hideProfile?: boolean;\n}\n\nexport const ProfileAction = ({ hideProfile = false }: ProfileActionProps) => {\n const navigate = useNavigate()\n const decodedToken = useContext(JwtContext)\n const [first, setFirst] = useState('')\n const [last, setLast] = useState('')\n\n useEffect(() => {\n if (decodedToken?.user === null) {\n return\n }\n setFirst(decodedToken!.user!.firstName)\n setLast(decodedToken!.user!.lastName)\n }, [decodedToken])\n\n const [logoutMutation] = useLogoutMutation({\n onCompleted: logoutActions,\n onError: logoutActions,\n })\n\n const onClick: MenuProps['onClick'] = async ({ key }) => {\n switch (key) {\n case 'logout':\n await logoutMutation()\n navigate(Routes.LOGIN)\n break\n }\n }\n\n const items = getMenuItems(hideProfile)\n\n return (\n \n } />\n \n )\n}\n","/**\n * @license React\n * use-sync-external-store-shim.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 e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.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 h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nexport { __assign, __read, __rest, __spreadArray, __values };\n","var ActionTypes;\n\n(function (ActionTypes) {\n ActionTypes[\"Start\"] = \"xstate.start\";\n ActionTypes[\"Stop\"] = \"xstate.stop\";\n ActionTypes[\"Raise\"] = \"xstate.raise\";\n ActionTypes[\"Send\"] = \"xstate.send\";\n ActionTypes[\"Cancel\"] = \"xstate.cancel\";\n ActionTypes[\"NullEvent\"] = \"\";\n ActionTypes[\"Assign\"] = \"xstate.assign\";\n ActionTypes[\"After\"] = \"xstate.after\";\n ActionTypes[\"DoneState\"] = \"done.state\";\n ActionTypes[\"DoneInvoke\"] = \"done.invoke\";\n ActionTypes[\"Log\"] = \"xstate.log\";\n ActionTypes[\"Init\"] = \"xstate.init\";\n ActionTypes[\"Invoke\"] = \"xstate.invoke\";\n ActionTypes[\"ErrorExecution\"] = \"error.execution\";\n ActionTypes[\"ErrorCommunication\"] = \"error.communication\";\n ActionTypes[\"ErrorPlatform\"] = \"error.platform\";\n ActionTypes[\"ErrorCustom\"] = \"xstate.error\";\n ActionTypes[\"Update\"] = \"xstate.update\";\n ActionTypes[\"Pure\"] = \"xstate.pure\";\n ActionTypes[\"Choose\"] = \"xstate.choose\";\n})(ActionTypes || (ActionTypes = {}));\n\nvar SpecialTargets;\n\n(function (SpecialTargets) {\n SpecialTargets[\"Parent\"] = \"#_parent\";\n SpecialTargets[\"Internal\"] = \"#_internal\";\n})(SpecialTargets || (SpecialTargets = {}));\n\nexport { ActionTypes, SpecialTargets };\n","import { ActionTypes } from './types.js';\n\nvar start = ActionTypes.Start;\nvar stop = ActionTypes.Stop;\nvar raise = ActionTypes.Raise;\nvar send = ActionTypes.Send;\nvar cancel = ActionTypes.Cancel;\nvar nullEvent = ActionTypes.NullEvent;\nvar assign = ActionTypes.Assign;\nvar after = ActionTypes.After;\nvar doneState = ActionTypes.DoneState;\nvar log = ActionTypes.Log;\nvar init = ActionTypes.Init;\nvar invoke = ActionTypes.Invoke;\nvar errorExecution = ActionTypes.ErrorExecution;\nvar errorPlatform = ActionTypes.ErrorPlatform;\nvar error = ActionTypes.ErrorCustom;\nvar update = ActionTypes.Update;\nvar choose = ActionTypes.Choose;\nvar pure = ActionTypes.Pure;\n\nexport { after, assign, cancel, choose, doneState, error, errorExecution, errorPlatform, init, invoke, log, nullEvent, pure, raise, send, start, stop, update };\n","var STATE_DELIMITER = '.';\nvar EMPTY_ACTIVITY_MAP = {};\nvar DEFAULT_GUARD_TYPE = 'xstate.guard';\nvar TARGETLESS_KEY = '';\n\nexport { DEFAULT_GUARD_TYPE, EMPTY_ACTIVITY_MAP, STATE_DELIMITER, TARGETLESS_KEY };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { SpecialTargets } from './types.js';\nimport { raise, send } from './actionTypes.js';\nimport { DEFAULT_GUARD_TYPE, TARGETLESS_KEY, STATE_DELIMITER } from './constants.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar _a;\nfunction keys(value) {\n return Object.keys(value);\n}\nfunction matchesState(parentStateId, childStateId, delimiter) {\n if (delimiter === void 0) {\n delimiter = STATE_DELIMITER;\n }\n\n var parentStateValue = toStateValue(parentStateId, delimiter);\n var childStateValue = toStateValue(childStateId, delimiter);\n\n if (isString(childStateValue)) {\n if (isString(parentStateValue)) {\n return childStateValue === parentStateValue;\n } // Parent more specific than child\n\n\n return false;\n }\n\n if (isString(parentStateValue)) {\n return parentStateValue in childStateValue;\n }\n\n return Object.keys(parentStateValue).every(function (key) {\n if (!(key in childStateValue)) {\n return false;\n }\n\n return matchesState(parentStateValue[key], childStateValue[key]);\n });\n}\nfunction getEventType(event) {\n try {\n return isString(event) || typeof event === 'number' ? \"\".concat(event) : event.type;\n } catch (e) {\n throw new Error('Events must be strings or objects with a string event.type property.');\n }\n}\nfunction getActionType(action) {\n try {\n return isString(action) || typeof action === 'number' ? \"\".concat(action) : isFunction(action) ? action.name : action.type;\n } catch (e) {\n throw new Error('Actions must be strings or objects with a string action.type property.');\n }\n}\nfunction toStatePath(stateId, delimiter) {\n try {\n if (isArray(stateId)) {\n return stateId;\n }\n\n return stateId.toString().split(delimiter);\n } catch (e) {\n throw new Error(\"'\".concat(stateId, \"' is not a valid state path.\"));\n }\n}\nfunction isStateLike(state) {\n return typeof state === 'object' && 'value' in state && 'context' in state && 'event' in state && '_event' in state;\n}\nfunction toStateValue(stateValue, delimiter) {\n if (isStateLike(stateValue)) {\n return stateValue.value;\n }\n\n if (isArray(stateValue)) {\n return pathToStateValue(stateValue);\n }\n\n if (typeof stateValue !== 'string') {\n return stateValue;\n }\n\n var statePath = toStatePath(stateValue, delimiter);\n return pathToStateValue(statePath);\n}\nfunction pathToStateValue(statePath) {\n if (statePath.length === 1) {\n return statePath[0];\n }\n\n var value = {};\n var marker = value;\n\n for (var i = 0; i < statePath.length - 1; i++) {\n if (i === statePath.length - 2) {\n marker[statePath[i]] = statePath[i + 1];\n } else {\n marker[statePath[i]] = {};\n marker = marker[statePath[i]];\n }\n }\n\n return value;\n}\nfunction mapValues(collection, iteratee) {\n var result = {};\n var collectionKeys = Object.keys(collection);\n\n for (var i = 0; i < collectionKeys.length; i++) {\n var key = collectionKeys[i];\n result[key] = iteratee(collection[key], key, collection, i);\n }\n\n return result;\n}\nfunction mapFilterValues(collection, iteratee, predicate) {\n var e_1, _a;\n\n var result = {};\n\n try {\n for (var _b = __values(Object.keys(collection)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var item = collection[key];\n\n if (!predicate(item)) {\n continue;\n }\n\n result[key] = iteratee(item, key, collection);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return result;\n}\n/**\r\n * Retrieves a value at the given path.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nvar path = function (props) {\n return function (object) {\n var e_2, _a;\n\n var result = object;\n\n try {\n for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var prop = props_1_1.value;\n result = result[prop];\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n return result;\n };\n};\n/**\r\n * Retrieves a value at the given path via the nested accessor prop.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nfunction nestedPath(props, accessorProp) {\n return function (object) {\n var e_3, _a;\n\n var result = object;\n\n try {\n for (var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {\n var prop = props_2_1.value;\n result = result[accessorProp][prop];\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n return result;\n };\n}\nfunction toStatePaths(stateValue) {\n if (!stateValue) {\n return [[]];\n }\n\n if (isString(stateValue)) {\n return [[stateValue]];\n }\n\n var result = flatten(Object.keys(stateValue).map(function (key) {\n var subStateValue = stateValue[key];\n\n if (typeof subStateValue !== 'string' && (!subStateValue || !Object.keys(subStateValue).length)) {\n return [[key]];\n }\n\n return toStatePaths(stateValue[key]).map(function (subPath) {\n return [key].concat(subPath);\n });\n }));\n return result;\n}\nfunction pathsToStateValue(paths) {\n var e_4, _a;\n\n var result = {};\n\n if (paths && paths.length === 1 && paths[0].length === 1) {\n return paths[0][0];\n }\n\n try {\n for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var currentPath = paths_1_1.value;\n var marker = result; // tslint:disable-next-line:prefer-for-of\n\n for (var i = 0; i < currentPath.length; i++) {\n var subPath = currentPath[i];\n\n if (i === currentPath.length - 2) {\n marker[subPath] = currentPath[i + 1];\n break;\n }\n\n marker[subPath] = marker[subPath] || {};\n marker = marker[subPath];\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n return result;\n}\nfunction flatten(array) {\n var _a;\n\n return (_a = []).concat.apply(_a, __spreadArray([], __read(array), false));\n}\nfunction toArrayStrict(value) {\n if (isArray(value)) {\n return value;\n }\n\n return [value];\n}\nfunction toArray(value) {\n if (value === undefined) {\n return [];\n }\n\n return toArrayStrict(value);\n}\nfunction mapContext(mapper, context, _event) {\n var e_5, _a;\n\n if (isFunction(mapper)) {\n return mapper(context, _event.data);\n }\n\n var result = {};\n\n try {\n for (var _b = __values(Object.keys(mapper)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var subMapper = mapper[key];\n\n if (isFunction(subMapper)) {\n result[key] = subMapper(context, _event.data);\n } else {\n result[key] = subMapper;\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return result;\n}\nfunction isBuiltInEvent(eventType) {\n return /^(done|error)\\./.test(eventType);\n}\nfunction isPromiseLike(value) {\n if (value instanceof Promise) {\n return true;\n } // Check if shape matches the Promise/A+ specification for a \"thenable\".\n\n\n if (value !== null && (isFunction(value) || typeof value === 'object') && isFunction(value.then)) {\n return true;\n }\n\n return false;\n}\nfunction isBehavior(value) {\n return value !== null && typeof value === 'object' && 'transition' in value && typeof value.transition === 'function';\n}\nfunction partition(items, predicate) {\n var e_6, _a;\n\n var _b = __read([[], []], 2),\n truthy = _b[0],\n falsy = _b[1];\n\n try {\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item = items_1_1.value;\n\n if (predicate(item)) {\n truthy.push(item);\n } else {\n falsy.push(item);\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n return [truthy, falsy];\n}\nfunction updateHistoryStates(hist, stateValue) {\n return mapValues(hist.states, function (subHist, key) {\n if (!subHist) {\n return undefined;\n }\n\n var subStateValue = (isString(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);\n\n if (!subStateValue) {\n return undefined;\n }\n\n return {\n current: subStateValue,\n states: updateHistoryStates(subHist, subStateValue)\n };\n });\n}\nfunction updateHistoryValue(hist, stateValue) {\n return {\n current: stateValue,\n states: updateHistoryStates(hist, stateValue)\n };\n}\nfunction updateContext(context, _event, assignActions, state) {\n if (!IS_PRODUCTION) {\n warn(!!context, 'Attempting to update undefined context');\n }\n\n var updatedContext = context ? assignActions.reduce(function (acc, assignAction) {\n var e_7, _a;\n\n var assignment = assignAction.assignment;\n var meta = {\n state: state,\n action: assignAction,\n _event: _event\n };\n var partialUpdate = {};\n\n if (isFunction(assignment)) {\n partialUpdate = assignment(acc, _event.data, meta);\n } else {\n try {\n for (var _b = __values(Object.keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var propAssignment = assignment[key];\n partialUpdate[key] = isFunction(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n\n return Object.assign({}, acc, partialUpdate);\n }, context) : context;\n return updatedContext;\n} // tslint:disable-next-line:no-empty\n\nvar warn = function () {};\n\nif (!IS_PRODUCTION) {\n warn = function (condition, message) {\n var error = condition instanceof Error ? condition : undefined;\n\n if (!error && condition) {\n return;\n }\n\n if (console !== undefined) {\n var args = [\"Warning: \".concat(message)];\n\n if (error) {\n args.push(error);\n } // tslint:disable-next-line:no-console\n\n\n console.warn.apply(console, args);\n }\n };\n}\nfunction isArray(value) {\n return Array.isArray(value);\n} // tslint:disable-next-line:ban-types\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isString(value) {\n return typeof value === 'string';\n}\nfunction toGuard(condition, guardMap) {\n if (!condition) {\n return undefined;\n }\n\n if (isString(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition,\n predicate: guardMap ? guardMap[condition] : undefined\n };\n }\n\n if (isFunction(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition.name,\n predicate: condition\n };\n }\n\n return condition;\n}\nfunction isObservable(value) {\n try {\n return 'subscribe' in value && isFunction(value.subscribe);\n } catch (e) {\n return false;\n }\n}\nvar symbolObservable = /*#__PURE__*/function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n}(); // TODO: to be removed in v5, left it out just to minimize the scope of the change and maintain compatibility with older versions of integration paackages\n\nvar interopSymbols = (_a = {}, _a[symbolObservable] = function () {\n return this;\n}, _a[Symbol.observable] = function () {\n return this;\n}, _a);\nfunction isMachine(value) {\n return !!value && '__xstatenode' in value;\n}\nfunction isActor(value) {\n return !!value && typeof value.send === 'function';\n}\nvar uniqueId = /*#__PURE__*/function () {\n var currentId = 0;\n return function () {\n currentId++;\n return currentId.toString(16);\n };\n}();\nfunction toEventObject(event, payload // id?: TEvent['type']\n) {\n if (isString(event) || typeof event === 'number') {\n return __assign({\n type: event\n }, payload);\n }\n\n return event;\n}\nfunction toSCXMLEvent(event, scxmlEvent) {\n if (!isString(event) && '$$type' in event && event.$$type === 'scxml') {\n return event;\n }\n\n var eventObject = toEventObject(event);\n return __assign({\n name: eventObject.type,\n data: eventObject,\n $$type: 'scxml',\n type: 'external'\n }, scxmlEvent);\n}\nfunction toTransitionConfigArray(event, configLike) {\n var transitions = toArrayStrict(configLike).map(function (transitionLike) {\n if (typeof transitionLike === 'undefined' || typeof transitionLike === 'string' || isMachine(transitionLike)) {\n return {\n target: transitionLike,\n event: event\n };\n }\n\n return __assign(__assign({}, transitionLike), {\n event: event\n });\n });\n return transitions;\n}\nfunction normalizeTarget(target) {\n if (target === undefined || target === TARGETLESS_KEY) {\n return undefined;\n }\n\n return toArray(target);\n}\nfunction reportUnhandledExceptionOnInvocation(originalError, currentError, id) {\n if (!IS_PRODUCTION) {\n var originalStackTrace = originalError.stack ? \" Stacktrace was '\".concat(originalError.stack, \"'\") : '';\n\n if (originalError === currentError) {\n // tslint:disable-next-line:no-console\n console.error(\"Missing onError handler for invocation '\".concat(id, \"', error was '\").concat(originalError, \"'.\").concat(originalStackTrace));\n } else {\n var stackTrace = currentError.stack ? \" Stacktrace was '\".concat(currentError.stack, \"'\") : ''; // tslint:disable-next-line:no-console\n\n console.error(\"Missing onError handler and/or unhandled exception/promise rejection for invocation '\".concat(id, \"'. \") + \"Original error: '\".concat(originalError, \"'. \").concat(originalStackTrace, \" Current error is '\").concat(currentError, \"'.\").concat(stackTrace));\n }\n }\n}\nfunction evaluateGuard(machine, guard, context, _event, state) {\n var guards = machine.options.guards;\n var guardMeta = {\n state: state,\n cond: guard,\n _event: _event\n }; // TODO: do not hardcode!\n\n if (guard.type === DEFAULT_GUARD_TYPE) {\n return ((guards === null || guards === void 0 ? void 0 : guards[guard.name]) || guard.predicate)(context, _event.data, guardMeta);\n }\n\n var condFn = guards === null || guards === void 0 ? void 0 : guards[guard.type];\n\n if (!condFn) {\n throw new Error(\"Guard '\".concat(guard.type, \"' is not implemented on machine '\").concat(machine.id, \"'.\"));\n }\n\n return condFn(context, _event.data, guardMeta);\n}\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n return {\n type: src\n };\n }\n\n return src;\n}\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n var noop = function () {};\n\n var isObserver = typeof nextHandler === 'object';\n var self = isObserver ? nextHandler : null;\n return {\n next: ((isObserver ? nextHandler.next : nextHandler) || noop).bind(self),\n error: ((isObserver ? nextHandler.error : errorHandler) || noop).bind(self),\n complete: ((isObserver ? nextHandler.complete : completionHandler) || noop).bind(self)\n };\n}\nfunction createInvokeId(stateNodeId, index) {\n return \"\".concat(stateNodeId, \":invocation[\").concat(index, \"]\");\n}\nfunction isRaisableAction(action) {\n return (action.type === raise || action.type === send && action.to === SpecialTargets.Internal) && typeof action.delay !== 'number';\n}\n\nexport { createInvokeId, evaluateGuard, flatten, getActionType, getEventType, interopSymbols, isActor, isArray, isBehavior, isBuiltInEvent, isFunction, isMachine, isObservable, isPromiseLike, isRaisableAction, isStateLike, isString, keys, mapContext, mapFilterValues, mapValues, matchesState, nestedPath, normalizeTarget, partition, path, pathToStateValue, pathsToStateValue, reportUnhandledExceptionOnInvocation, symbolObservable, toArray, toArrayStrict, toEventObject, toGuard, toInvokeSource, toObserver, toSCXMLEvent, toStatePath, toStatePaths, toStateValue, toTransitionConfigArray, uniqueId, updateContext, updateHistoryStates, updateHistoryValue, warn };\n","import { __assign, __spreadArray, __read, __values } from './_virtual/_tslib.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { init, raise as raise$1, send as send$1, update, log as log$1, cancel as cancel$1, assign as assign$1, error as error$1, stop as stop$1, pure as pure$1, choose as choose$1 } from './actionTypes.js';\nimport * as actionTypes from './actionTypes.js';\nexport { actionTypes };\nimport { toSCXMLEvent, isString, isFunction, toEventObject, getEventType, updateContext, flatten, isArray, toArray, toGuard, evaluateGuard, warn } from './utils.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar initEvent = /*#__PURE__*/toSCXMLEvent({\n type: init\n});\nfunction getActionFunction(actionType, actionFunctionMap) {\n return actionFunctionMap ? actionFunctionMap[actionType] || undefined : undefined;\n}\nfunction toActionObject(action, actionFunctionMap) {\n var actionObject;\n\n if (isString(action) || typeof action === 'number') {\n var exec = getActionFunction(action, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = {\n type: action,\n exec: exec\n };\n } else if (exec) {\n actionObject = exec;\n } else {\n actionObject = {\n type: action,\n exec: undefined\n };\n }\n } else if (isFunction(action)) {\n actionObject = {\n // Convert action to string if unnamed\n type: action.name || action.toString(),\n exec: action\n };\n } else {\n var exec = getActionFunction(action.type, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = __assign(__assign({}, action), {\n exec: exec\n });\n } else if (exec) {\n var actionType = exec.type || action.type;\n actionObject = __assign(__assign(__assign({}, exec), action), {\n type: actionType\n });\n } else {\n actionObject = action;\n }\n }\n\n return actionObject;\n}\nvar toActionObjects = function (action, actionFunctionMap) {\n if (!action) {\n return [];\n }\n\n var actions = isArray(action) ? action : [action];\n return actions.map(function (subAction) {\n return toActionObject(subAction, actionFunctionMap);\n });\n};\nfunction toActivityDefinition(action) {\n var actionObject = toActionObject(action);\n return __assign(__assign({\n id: isString(action) ? action : actionObject.id\n }, actionObject), {\n type: actionObject.type\n });\n}\n/**\r\n * Raises an event. This places the event in the internal event queue, so that\r\n * the event is immediately consumed by the machine in the current step.\r\n *\r\n * @param eventType The event to raise.\r\n */\n\nfunction raise(event, options) {\n return {\n type: raise$1,\n event: typeof event === 'function' ? event : toEventObject(event),\n delay: options ? options.delay : undefined,\n id: options === null || options === void 0 ? void 0 : options.id\n };\n}\nfunction resolveRaise(action, ctx, _event, delaysMap) {\n var meta = {\n _event: _event\n };\n var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);\n var resolvedDelay;\n\n if (isString(action.delay)) {\n var configDelay = delaysMap && delaysMap[action.delay];\n resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;\n } else {\n resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;\n }\n\n return __assign(__assign({}, action), {\n type: raise$1,\n _event: resolvedEvent,\n delay: resolvedDelay\n });\n}\n/**\r\n * Sends an event. This returns an action that will be read by an interpreter to\r\n * send the event in the next step, after the current step is finished executing.\r\n *\r\n * @deprecated Use the `sendTo(...)` action creator instead.\r\n *\r\n * @param event The event to send.\r\n * @param options Options to pass into the send event:\r\n * - `id` - The unique send event identifier (used with `cancel()`).\r\n * - `delay` - The number of milliseconds to delay the sending of the event.\r\n * - `to` - The target of this event (by default, the machine the event was sent from).\r\n */\n\nfunction send(event, options) {\n return {\n to: options ? options.to : undefined,\n type: send$1,\n event: isFunction(event) ? event : toEventObject(event),\n delay: options ? options.delay : undefined,\n // TODO: don't auto-generate IDs here like that\n // there is too big chance of the ID collision\n id: options && options.id !== undefined ? options.id : isFunction(event) ? event.name : getEventType(event)\n };\n}\nfunction resolveSend(action, ctx, _event, delaysMap) {\n var meta = {\n _event: _event\n }; // TODO: helper function for resolving Expr\n\n var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);\n var resolvedDelay;\n\n if (isString(action.delay)) {\n var configDelay = delaysMap && delaysMap[action.delay];\n resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;\n } else {\n resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;\n }\n\n var resolvedTarget = isFunction(action.to) ? action.to(ctx, _event.data, meta) : action.to;\n return __assign(__assign({}, action), {\n to: resolvedTarget,\n _event: resolvedEvent,\n event: resolvedEvent.data,\n delay: resolvedDelay\n });\n}\n/**\r\n * Sends an event to this machine's parent.\r\n *\r\n * @param event The event to send to the parent machine.\r\n * @param options Options to pass into the send event.\r\n */\n\nfunction sendParent(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\n/**\r\n * Sends an event to an actor.\r\n *\r\n * @param actor The `ActorRef` to send the event to.\r\n * @param event The event to send, or an expression that evaluates to the event to send\r\n * @param options Send action options\r\n * @returns An XState send action object\r\n */\n\nfunction sendTo(actor, event, options) {\n return send(event, __assign(__assign({}, options), {\n to: actor\n }));\n}\n/**\r\n * Sends an update event to this machine's parent.\r\n */\n\nfunction sendUpdate() {\n return sendParent(update);\n}\n/**\r\n * Sends an event back to the sender of the original event.\r\n *\r\n * @param event The event to send back to the sender\r\n * @param options Options to pass into the send event\r\n */\n\nfunction respond(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: function (_, __, _a) {\n var _event = _a._event;\n return _event.origin; // TODO: handle when _event.origin is undefined\n }\n }));\n}\n\nvar defaultLogExpr = function (context, event) {\n return {\n context: context,\n event: event\n };\n};\n/**\r\n *\r\n * @param expr The expression function to evaluate which will be logged.\r\n * Takes in 2 arguments:\r\n * - `ctx` - the current state context\r\n * - `event` - the event that caused this action to be executed.\r\n * @param label The label to give to the logged expression.\r\n */\n\n\nfunction log(expr, label) {\n if (expr === void 0) {\n expr = defaultLogExpr;\n }\n\n return {\n type: log$1,\n label: label,\n expr: expr\n };\n}\nvar resolveLog = function (action, ctx, _event) {\n return __assign(__assign({}, action), {\n value: isString(action.expr) ? action.expr : action.expr(ctx, _event.data, {\n _event: _event\n })\n });\n};\n/**\r\n * Cancels an in-flight `send(...)` action. A canceled sent action will not\r\n * be executed, nor will its event be sent, unless it has already been sent\r\n * (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).\r\n *\r\n * @param sendId The `id` of the `send(...)` action to cancel.\r\n */\n\nvar cancel = function (sendId) {\n return {\n type: cancel$1,\n sendId: sendId\n };\n};\n/**\r\n * Starts an activity.\r\n *\r\n * @param activity The activity to start.\r\n */\n\nfunction start(activity) {\n var activityDef = toActivityDefinition(activity);\n return {\n type: ActionTypes.Start,\n activity: activityDef,\n exec: undefined\n };\n}\n/**\r\n * Stops an activity.\r\n *\r\n * @param actorRef The activity to stop.\r\n */\n\nfunction stop(actorRef) {\n var activity = isFunction(actorRef) ? actorRef : toActivityDefinition(actorRef);\n return {\n type: ActionTypes.Stop,\n activity: activity,\n exec: undefined\n };\n}\nfunction resolveStop(action, context, _event) {\n var actorRefOrString = isFunction(action.activity) ? action.activity(context, _event.data) : action.activity;\n var resolvedActorRef = typeof actorRefOrString === 'string' ? {\n id: actorRefOrString\n } : actorRefOrString;\n var actionObject = {\n type: ActionTypes.Stop,\n activity: resolvedActorRef\n };\n return actionObject;\n}\n/**\r\n * Updates the current context of the machine.\r\n *\r\n * @param assignment An object that represents the partial context to update.\r\n */\n\nvar assign = function (assignment) {\n return {\n type: assign$1,\n assignment: assignment\n };\n};\nfunction isActionObject(action) {\n return typeof action === 'object' && 'type' in action;\n}\n/**\r\n * Returns an event type that represents an implicit event that\r\n * is sent after the specified `delay`.\r\n *\r\n * @param delayRef The delay in milliseconds\r\n * @param id The state node ID where this event is handled\r\n */\n\nfunction after(delayRef, id) {\n var idSuffix = id ? \"#\".concat(id) : '';\n return \"\".concat(ActionTypes.After, \"(\").concat(delayRef, \")\").concat(idSuffix);\n}\n/**\r\n * Returns an event that represents that a final state node\r\n * has been reached in the parent state node.\r\n *\r\n * @param id The final state node's parent state node `id`\r\n * @param data The data to pass into the event\r\n */\n\nfunction done(id, data) {\n var type = \"\".concat(ActionTypes.DoneState, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\n/**\r\n * Returns an event that represents that an invoked service has terminated.\r\n *\r\n * An invoked service is terminated when it has reached a top-level final state node,\r\n * but not when it is canceled.\r\n *\r\n * @param id The final state node ID\r\n * @param data The data to pass into the event\r\n */\n\nfunction doneInvoke(id, data) {\n var type = \"\".concat(ActionTypes.DoneInvoke, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction error(id, data) {\n var type = \"\".concat(ActionTypes.ErrorPlatform, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction pure(getActions) {\n return {\n type: ActionTypes.Pure,\n get: getActions\n };\n}\n/**\r\n * Forwards (sends) an event to a specified service.\r\n *\r\n * @param target The target service to forward the event to.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction forwardTo(target, options) {\n if (!IS_PRODUCTION && (!target || typeof target === 'function')) {\n var originalTarget_1 = target;\n\n target = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var resolvedTarget = typeof originalTarget_1 === 'function' ? originalTarget_1.apply(void 0, __spreadArray([], __read(args), false)) : originalTarget_1;\n\n if (!resolvedTarget) {\n throw new Error(\"Attempted to forward event to undefined actor. This risks an infinite loop in the sender.\");\n }\n\n return resolvedTarget;\n };\n }\n\n return send(function (_, event) {\n return event;\n }, __assign(__assign({}, options), {\n to: target\n }));\n}\n/**\r\n * Escalates an error by sending it as an event to this machine's parent.\r\n *\r\n * @param errorData The error data to send, or the expression function that\r\n * takes in the `context`, `event`, and `meta`, and returns the error data to send.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction escalate(errorData, options) {\n return sendParent(function (context, event, meta) {\n return {\n type: error$1,\n data: isFunction(errorData) ? errorData(context, event, meta) : errorData\n };\n }, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\nfunction choose(conds) {\n return {\n type: ActionTypes.Choose,\n conds: conds\n };\n}\n\nvar pluckAssigns = function (actionBlocks) {\n var e_1, _a;\n\n var assignActions = [];\n\n try {\n for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {\n var block = actionBlocks_1_1.value;\n var i = 0;\n\n while (i < block.actions.length) {\n if (block.actions[i].type === assign$1) {\n assignActions.push(block.actions[i]);\n block.actions.splice(i, 1);\n continue;\n }\n\n i++;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return assignActions;\n};\n\nfunction resolveActions(machine, currentState, currentContext, _event, actionBlocks, predictableExec, preserveActionOrder) {\n if (preserveActionOrder === void 0) {\n preserveActionOrder = false;\n }\n\n var assignActions = preserveActionOrder ? [] : pluckAssigns(actionBlocks);\n var updatedContext = assignActions.length ? updateContext(currentContext, _event, assignActions, currentState) : currentContext;\n var preservedContexts = preserveActionOrder ? [currentContext] : undefined;\n var deferredToBlockEnd = [];\n\n function handleAction(blockType, actionObject) {\n var _a;\n\n switch (actionObject.type) {\n case raise$1:\n {\n var raisedAction = resolveRaise(actionObject, updatedContext, _event, machine.options.delays);\n\n if (predictableExec && typeof raisedAction.delay === 'number') {\n predictableExec(raisedAction, updatedContext, _event);\n }\n\n return raisedAction;\n }\n\n case send$1:\n var sendAction = resolveSend(actionObject, updatedContext, _event, machine.options.delays); // TODO: fix ActionTypes.Init\n\n if (!IS_PRODUCTION) {\n var configuredDelay = actionObject.delay; // warn after resolving as we can create better contextual message here\n\n warn(!isString(configuredDelay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length\n \"No delay reference for delay expression '\".concat(configuredDelay, \"' was found on machine '\").concat(machine.id, \"'\"));\n }\n\n if (predictableExec && sendAction.to !== SpecialTargets.Internal) {\n if (blockType === 'entry') {\n deferredToBlockEnd.push(sendAction);\n } else {\n predictableExec(sendAction, updatedContext, _event);\n }\n }\n\n return sendAction;\n\n case log$1:\n {\n var resolved = resolveLog(actionObject, updatedContext, _event);\n predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, updatedContext, _event);\n return resolved;\n }\n\n case choose$1:\n {\n var chooseAction = actionObject;\n var matchedActions = (_a = chooseAction.conds.find(function (condition) {\n var guard = toGuard(condition.cond, machine.options.guards);\n return !guard || evaluateGuard(machine, guard, updatedContext, _event, !predictableExec ? currentState : undefined);\n })) === null || _a === void 0 ? void 0 : _a.actions;\n\n if (!matchedActions) {\n return [];\n }\n\n var _b = __read(resolveActions(machine, currentState, updatedContext, _event, [{\n type: blockType,\n actions: toActionObjects(toArray(matchedActions), machine.options.actions)\n }], predictableExec, preserveActionOrder), 2),\n resolvedActionsFromChoose = _b[0],\n resolvedContextFromChoose = _b[1];\n\n updatedContext = resolvedContextFromChoose;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromChoose;\n }\n\n case pure$1:\n {\n var matchedActions = actionObject.get(updatedContext, _event.data);\n\n if (!matchedActions) {\n return [];\n }\n\n var _c = __read(resolveActions(machine, currentState, updatedContext, _event, [{\n type: blockType,\n actions: toActionObjects(toArray(matchedActions), machine.options.actions)\n }], predictableExec, preserveActionOrder), 2),\n resolvedActionsFromPure = _c[0],\n resolvedContext = _c[1];\n\n updatedContext = resolvedContext;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromPure;\n }\n\n case stop$1:\n {\n var resolved = resolveStop(actionObject, updatedContext, _event);\n predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, currentContext, _event);\n return resolved;\n }\n\n case assign$1:\n {\n updatedContext = updateContext(updatedContext, _event, [actionObject], !predictableExec ? currentState : undefined);\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n break;\n }\n\n default:\n var resolvedActionObject = toActionObject(actionObject, machine.options.actions);\n var exec_1 = resolvedActionObject.exec;\n\n if (predictableExec) {\n predictableExec(resolvedActionObject, updatedContext, _event);\n } else if (exec_1 && preservedContexts) {\n var contextIndex_1 = preservedContexts.length - 1;\n\n var wrapped = __assign(__assign({}, resolvedActionObject), {\n exec: function (_ctx) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n exec_1.apply(void 0, __spreadArray([preservedContexts[contextIndex_1]], __read(args), false));\n }\n });\n\n resolvedActionObject = wrapped;\n }\n\n return resolvedActionObject;\n }\n }\n\n function processBlock(block) {\n var e_2, _a;\n\n var resolvedActions = [];\n\n try {\n for (var _b = __values(block.actions), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n var resolved = handleAction(block.type, action);\n\n if (resolved) {\n resolvedActions = resolvedActions.concat(resolved);\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n deferredToBlockEnd.forEach(function (action) {\n predictableExec(action, updatedContext, _event);\n });\n deferredToBlockEnd.length = 0;\n return resolvedActions;\n }\n\n var resolvedActions = flatten(actionBlocks.map(processBlock));\n return [resolvedActions, updatedContext];\n}\n\nexport { after, assign, cancel, choose, done, doneInvoke, error, escalate, forwardTo, getActionFunction, initEvent, isActionObject, log, pure, raise, resolveActions, resolveLog, resolveRaise, resolveSend, resolveStop, respond, send, sendParent, sendTo, sendUpdate, start, stop, toActionObject, toActionObjects, toActivityDefinition };\n","/**\r\n * Maintains a stack of the current service in scope.\r\n * This is used to provide the correct service to spawn().\r\n */\nvar serviceStack = [];\nvar provide = function (service, fn) {\n serviceStack.push(service);\n var result = fn(service);\n serviceStack.pop();\n return result;\n};\nvar consume = function (fn) {\n return fn(serviceStack[serviceStack.length - 1]);\n};\n\nexport { consume, provide };\n","import { __assign } from './_virtual/_tslib.js';\nimport { symbolObservable, toInvokeSource, mapContext, isMachine } from './utils.js';\nimport { provide } from './serviceScope.js';\n\nfunction createNullActor(id) {\n var _a;\n\n return _a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a;\n}\n/**\r\n * Creates a deferred actor that is able to be invoked given the provided\r\n * invocation information in its `.meta` value.\r\n *\r\n * @param invokeDefinition The meta information needed to invoke the actor.\r\n */\n\nfunction createInvocableActor(invokeDefinition, machine, context, _event) {\n var _a;\n\n var invokeSrc = toInvokeSource(invokeDefinition.src);\n var serviceCreator = (_a = machine === null || machine === void 0 ? void 0 : machine.options.services) === null || _a === void 0 ? void 0 : _a[invokeSrc.type];\n var resolvedData = invokeDefinition.data ? mapContext(invokeDefinition.data, context, _event) : undefined;\n var tempActor = serviceCreator ? createDeferredActor(serviceCreator, invokeDefinition.id, resolvedData) : createNullActor(invokeDefinition.id); // @ts-ignore\n\n tempActor.meta = invokeDefinition;\n return tempActor;\n}\nfunction createDeferredActor(entity, id, data) {\n var tempActor = createNullActor(id); // @ts-ignore\n\n tempActor.deferred = true;\n\n if (isMachine(entity)) {\n // \"mute\" the existing service scope so potential spawned actors within the `.initialState` stay deferred here\n var initialState_1 = tempActor.state = provide(undefined, function () {\n return (data ? entity.withContext(data) : entity).initialState;\n });\n\n tempActor.getSnapshot = function () {\n return initialState_1;\n };\n }\n\n return tempActor;\n}\nfunction isActor(item) {\n try {\n return typeof item.send === 'function';\n } catch (e) {\n return false;\n }\n}\nfunction isSpawnedActor(item) {\n return isActor(item) && 'id' in item;\n} // TODO: refactor the return type, this could be written in a better way but it's best to avoid unneccessary breaking changes now\n\nfunction toActorRef(actorRefLike) {\n var _a;\n\n return __assign((_a = {\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n id: 'anonymous',\n getSnapshot: function () {\n return undefined;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a), actorRefLike);\n}\n\nexport { createDeferredActor, createInvocableActor, createNullActor, isActor, isSpawnedActor, toActorRef };\n","import { __values, __spreadArray, __read } from './_virtual/_tslib.js';\nimport { flatten } from './utils.js';\n\nvar isLeafNode = function (stateNode) {\n return stateNode.type === 'atomic' || stateNode.type === 'final';\n};\nfunction getAllChildren(stateNode) {\n return Object.keys(stateNode.states).map(function (key) {\n return stateNode.states[key];\n });\n}\nfunction getChildren(stateNode) {\n return getAllChildren(stateNode).filter(function (sn) {\n return sn.type !== 'history';\n });\n}\nfunction getAllStateNodes(stateNode) {\n var stateNodes = [stateNode];\n\n if (isLeafNode(stateNode)) {\n return stateNodes;\n }\n\n return stateNodes.concat(flatten(getChildren(stateNode).map(getAllStateNodes)));\n}\nfunction getConfiguration(prevStateNodes, stateNodes) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d;\n\n var prevConfiguration = new Set(prevStateNodes);\n var prevAdjList = getAdjList(prevConfiguration);\n var configuration = new Set(stateNodes);\n\n try {\n // add all ancestors\n for (var configuration_1 = __values(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()) {\n var s = configuration_1_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (configuration_1_1 && !configuration_1_1.done && (_a = configuration_1.return)) _a.call(configuration_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n var adjList = getAdjList(configuration);\n\n try {\n // add descendants\n for (var configuration_2 = __values(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()) {\n var s = configuration_2_1.value; // if previously active, add existing child nodes\n\n if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {\n if (prevAdjList.get(s)) {\n prevAdjList.get(s).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n s.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n } else {\n if (s.type === 'parallel') {\n try {\n for (var _e = (e_3 = void 0, __values(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var child = _f.value;\n\n if (!configuration.has(child)) {\n configuration.add(child);\n\n if (prevAdjList.get(child)) {\n prevAdjList.get(child).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n child.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_c = _e.return)) _c.call(_e);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n }\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n try {\n // add all ancestors\n for (var configuration_3 = __values(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()) {\n var s = configuration_3_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n return configuration;\n}\n\nfunction getValueFromAdj(baseNode, adjList) {\n var childStateNodes = adjList.get(baseNode);\n\n if (!childStateNodes) {\n return {}; // todo: fix?\n }\n\n if (baseNode.type === 'compound') {\n var childStateNode = childStateNodes[0];\n\n if (childStateNode) {\n if (isLeafNode(childStateNode)) {\n return childStateNode.key;\n }\n } else {\n return {};\n }\n }\n\n var stateValue = {};\n childStateNodes.forEach(function (csn) {\n stateValue[csn.key] = getValueFromAdj(csn, adjList);\n });\n return stateValue;\n}\n\nfunction getAdjList(configuration) {\n var e_5, _a;\n\n var adjList = new Map();\n\n try {\n for (var configuration_4 = __values(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()) {\n var s = configuration_4_1.value;\n\n if (!adjList.has(s)) {\n adjList.set(s, []);\n }\n\n if (s.parent) {\n if (!adjList.has(s.parent)) {\n adjList.set(s.parent, []);\n }\n\n adjList.get(s.parent).push(s);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (configuration_4_1 && !configuration_4_1.done && (_a = configuration_4.return)) _a.call(configuration_4);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return adjList;\n}\nfunction getValue(rootNode, configuration) {\n var config = getConfiguration([rootNode], configuration);\n return getValueFromAdj(rootNode, getAdjList(config));\n}\nfunction has(iterable, item) {\n if (Array.isArray(iterable)) {\n return iterable.some(function (member) {\n return member === item;\n });\n }\n\n if (iterable instanceof Set) {\n return iterable.has(item);\n }\n\n return false; // TODO: fix\n}\nfunction nextEvents(configuration) {\n return __spreadArray([], __read(new Set(flatten(__spreadArray([], __read(configuration.map(function (sn) {\n return sn.ownEvents;\n })), false)))), false);\n}\nfunction isInFinalState(configuration, stateNode) {\n if (stateNode.type === 'compound') {\n return getChildren(stateNode).some(function (s) {\n return s.type === 'final' && has(configuration, s);\n });\n }\n\n if (stateNode.type === 'parallel') {\n return getChildren(stateNode).every(function (sn) {\n return isInFinalState(configuration, sn);\n });\n }\n\n return false;\n}\nfunction getMeta(configuration) {\n if (configuration === void 0) {\n configuration = [];\n }\n\n return configuration.reduce(function (acc, stateNode) {\n if (stateNode.meta !== undefined) {\n acc[stateNode.id] = stateNode.meta;\n }\n\n return acc;\n }, {});\n}\nfunction getTagsFromConfiguration(configuration) {\n return new Set(flatten(configuration.map(function (sn) {\n return sn.tags;\n })));\n}\n\nexport { getAdjList, getAllChildren, getAllStateNodes, getChildren, getConfiguration, getMeta, getTagsFromConfiguration, getValue, has, isInFinalState, isLeafNode, nextEvents };\n","import { __assign, __spreadArray, __read, __rest } from './_virtual/_tslib.js';\nimport { EMPTY_ACTIVITY_MAP } from './constants.js';\nimport { isString, matchesState, warn } from './utils.js';\nimport { getMeta, nextEvents } from './stateUtils.js';\nimport { initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nfunction stateValuesEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a === undefined || b === undefined) {\n return false;\n }\n\n if (isString(a) || isString(b)) {\n return a === b;\n }\n\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n return aKeys.length === bKeys.length && aKeys.every(function (key) {\n return stateValuesEqual(a[key], b[key]);\n });\n}\nfunction isStateConfig(state) {\n if (typeof state !== 'object' || state === null) {\n return false;\n }\n\n return 'value' in state && '_event' in state;\n}\n/**\r\n * @deprecated Use `isStateConfig(object)` or `state instanceof State` instead.\r\n */\n\nvar isState = isStateConfig;\nfunction bindActionToState(action, state) {\n var exec = action.exec;\n\n var boundAction = __assign(__assign({}, action), {\n exec: exec !== undefined ? function () {\n return exec(state.context, state.event, {\n action: action,\n state: state,\n _event: state._event\n });\n } : undefined\n });\n\n return boundAction;\n}\n\nvar State =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new State instance.\r\n * @param value The state value\r\n * @param context The extended state\r\n * @param historyValue The tree representing historical values of the state nodes\r\n * @param history The previous state\r\n * @param actions An array of action objects to execute as side-effects\r\n * @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).\r\n * @param meta\r\n * @param events Internal event queue. Should be empty with run-to-completion semantics.\r\n * @param configuration\r\n */\n function State(config) {\n var _this = this;\n\n var _a;\n\n this.actions = [];\n this.activities = EMPTY_ACTIVITY_MAP;\n this.meta = {};\n this.events = [];\n this.value = config.value;\n this.context = config.context;\n this._event = config._event;\n this._sessionid = config._sessionid;\n this.event = this._event.data;\n this.historyValue = config.historyValue;\n this.history = config.history;\n this.actions = config.actions || [];\n this.activities = config.activities || EMPTY_ACTIVITY_MAP;\n this.meta = getMeta(config.configuration);\n this.events = config.events || [];\n this.matches = this.matches.bind(this);\n this.toStrings = this.toStrings.bind(this);\n this.configuration = config.configuration;\n this.transitions = config.transitions;\n this.children = config.children;\n this.done = !!config.done;\n this.tags = (_a = Array.isArray(config.tags) ? new Set(config.tags) : config.tags) !== null && _a !== void 0 ? _a : new Set();\n this.machine = config.machine;\n Object.defineProperty(this, 'nextEvents', {\n get: function () {\n return nextEvents(_this.configuration);\n }\n });\n }\n /**\r\n * Creates a new State instance for the given `stateValue` and `context`.\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.from = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (stateValue.context !== context) {\n return new State({\n value: stateValue.value,\n context: context,\n _event: stateValue._event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n actions: [],\n activities: stateValue.activities,\n meta: {},\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n }\n\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: undefined,\n history: undefined,\n actions: [],\n activities: undefined,\n meta: undefined,\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n };\n /**\r\n * Creates a new State instance for the given `config`.\r\n * @param config The state config\r\n */\n\n\n State.create = function (config) {\n return new State(config);\n };\n /**\r\n * Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.inert = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (!stateValue.actions.length) {\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue.value,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n activities: stateValue.activities,\n configuration: stateValue.configuration,\n transitions: [],\n children: {}\n });\n }\n\n return State.from(stateValue, context);\n };\n /**\r\n * Returns an array of all the string leaf state node paths.\r\n * @param stateValue\r\n * @param delimiter The character(s) that separate each subpath in the string state node path.\r\n */\n\n\n State.prototype.toStrings = function (stateValue, delimiter) {\n var _this = this;\n\n if (stateValue === void 0) {\n stateValue = this.value;\n }\n\n if (delimiter === void 0) {\n delimiter = '.';\n }\n\n if (isString(stateValue)) {\n return [stateValue];\n }\n\n var valueKeys = Object.keys(stateValue);\n return valueKeys.concat.apply(valueKeys, __spreadArray([], __read(valueKeys.map(function (key) {\n return _this.toStrings(stateValue[key], delimiter).map(function (s) {\n return key + delimiter + s;\n });\n })), false));\n };\n\n State.prototype.toJSON = function () {\n var _a = this;\n _a.configuration;\n _a.transitions;\n var tags = _a.tags;\n _a.machine;\n var jsonValues = __rest(_a, [\"configuration\", \"transitions\", \"tags\", \"machine\"]);\n\n return __assign(__assign({}, jsonValues), {\n tags: Array.from(tags)\n });\n };\n\n State.prototype.matches = function (parentStateValue) {\n return matchesState(parentStateValue, this.value);\n };\n /**\r\n * Whether the current state configuration has a state node with the specified `tag`.\r\n * @param tag\r\n */\n\n\n State.prototype.hasTag = function (tag) {\n return this.tags.has(tag);\n };\n /**\r\n * Determines whether sending the `event` will cause a non-forbidden transition\r\n * to be selected, even if the transitions have no actions nor\r\n * change the state value.\r\n *\r\n * @param event The event to test\r\n * @returns Whether the event will cause a transition\r\n */\n\n\n State.prototype.can = function (event) {\n var _a;\n\n if (IS_PRODUCTION) {\n warn(!!this.machine, \"state.can(...) used outside of a machine-created State object; this will always return false.\");\n }\n\n var transitionData = (_a = this.machine) === null || _a === void 0 ? void 0 : _a.getTransitionData(this, event);\n return !!(transitionData === null || transitionData === void 0 ? void 0 : transitionData.transitions.length) && // Check that at least one transition is not forbidden\n transitionData.transitions.some(function (t) {\n return t.target !== undefined || t.actions.length;\n });\n };\n\n return State;\n}();\n\nexport { State, bindActionToState, isState, isStateConfig, stateValuesEqual };\n","import { __assign } from './_virtual/_tslib.js';\n\nvar defaultOptions = {\n deferEvents: false\n};\n\nvar Scheduler =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function Scheduler(options) {\n this.processingEvent = false;\n this.queue = [];\n this.initialized = false;\n this.options = __assign(__assign({}, defaultOptions), options);\n }\n\n Scheduler.prototype.initialize = function (callback) {\n this.initialized = true;\n\n if (callback) {\n if (!this.options.deferEvents) {\n this.schedule(callback);\n return;\n }\n\n this.process(callback);\n }\n\n this.flushEvents();\n };\n\n Scheduler.prototype.schedule = function (task) {\n if (!this.initialized || this.processingEvent) {\n this.queue.push(task);\n return;\n }\n\n if (this.queue.length !== 0) {\n throw new Error('Event queue should be empty when it is not processing events');\n }\n\n this.process(task);\n this.flushEvents();\n };\n\n Scheduler.prototype.clear = function () {\n this.queue = [];\n };\n\n Scheduler.prototype.flushEvents = function () {\n var nextCallback = this.queue.shift();\n\n while (nextCallback) {\n this.process(nextCallback);\n nextCallback = this.queue.shift();\n }\n };\n\n Scheduler.prototype.process = function (callback) {\n this.processingEvent = true;\n\n try {\n callback();\n } catch (e) {\n // there is no use to keep the future events\n // as the situation is not anymore the same\n this.clear();\n throw e;\n } finally {\n this.processingEvent = false;\n }\n };\n\n return Scheduler;\n}();\n\nexport { Scheduler };\n","var children = /*#__PURE__*/new Map();\nvar sessionIdIndex = 0;\nvar registry = {\n bookId: function () {\n return \"x:\".concat(sessionIdIndex++);\n },\n register: function (id, actor) {\n children.set(id, actor);\n return id;\n },\n get: function (id) {\n return children.get(id);\n },\n free: function (id) {\n children.delete(id);\n }\n};\n\nexport { registry };\n","import { IS_PRODUCTION } from './environment.js';\n\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n\n if (typeof self !== 'undefined') {\n return self;\n }\n\n if (typeof window !== 'undefined') {\n return window;\n }\n\n if (typeof global !== 'undefined') {\n return global;\n }\n\n if (!IS_PRODUCTION) {\n console.warn('XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues');\n }\n}\n\nfunction getDevTools() {\n var global = getGlobal();\n\n if (global && '__xstate__' in global) {\n return global.__xstate__;\n }\n\n return undefined;\n}\n\nfunction registerService(service) {\n if (!getGlobal()) {\n return;\n }\n\n var devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n}\n\nexport { getGlobal, registerService };\n","import { error, doneInvoke } from './actions.js';\nimport { toActorRef } from './Actor.js';\nimport { toObserver } from './utils.js';\n\n/**\r\n * Returns an actor behavior from a reducer and its initial state.\r\n *\r\n * @param transition The pure reducer that returns the next state given the current state and event.\r\n * @param initialState The initial state of the reducer.\r\n * @returns An actor behavior\r\n */\n\nfunction fromReducer(transition, initialState) {\n return {\n transition: transition,\n initialState: initialState\n };\n}\nfunction fromPromise(promiseFn) {\n var initialState = {\n error: undefined,\n data: undefined,\n status: 'pending'\n };\n return {\n transition: function (state, event, _a) {\n var parent = _a.parent,\n id = _a.id,\n observers = _a.observers;\n\n switch (event.type) {\n case 'fulfill':\n parent === null || parent === void 0 ? void 0 : parent.send(doneInvoke(id, event.data));\n return {\n error: undefined,\n data: event.data,\n status: 'fulfilled'\n };\n\n case 'reject':\n parent === null || parent === void 0 ? void 0 : parent.send(error(id, event.error));\n observers.forEach(function (observer) {\n observer.error(event.error);\n });\n return {\n error: event.error,\n data: undefined,\n status: 'rejected'\n };\n\n default:\n return state;\n }\n },\n initialState: initialState,\n start: function (_a) {\n var self = _a.self;\n promiseFn().then(function (data) {\n self.send({\n type: 'fulfill',\n data: data\n });\n }, function (reason) {\n self.send({\n type: 'reject',\n error: reason\n });\n });\n return initialState;\n }\n };\n}\nfunction spawnBehavior(behavior, options) {\n if (options === void 0) {\n options = {};\n }\n\n var state = behavior.initialState;\n var observers = new Set();\n var mailbox = [];\n var flushing = false;\n\n var flush = function () {\n if (flushing) {\n return;\n }\n\n flushing = true;\n\n while (mailbox.length > 0) {\n var event_1 = mailbox.shift();\n state = behavior.transition(state, event_1, actorCtx);\n observers.forEach(function (observer) {\n return observer.next(state);\n });\n }\n\n flushing = false;\n };\n\n var actor = toActorRef({\n id: options.id,\n send: function (event) {\n mailbox.push(event);\n flush();\n },\n getSnapshot: function () {\n return state;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n observers.add(observer);\n observer.next(state);\n return {\n unsubscribe: function () {\n observers.delete(observer);\n }\n };\n }\n });\n var actorCtx = {\n parent: options.parent,\n self: actor,\n id: options.id || 'anonymous',\n observers: observers\n };\n state = behavior.start ? behavior.start(actorCtx) : state;\n return actor;\n}\n\nexport { fromPromise, fromReducer, spawnBehavior };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { isStateConfig, State, bindActionToState } from './State.js';\nimport { errorPlatform, update, error as error$1, log, stop, start, cancel, send, raise } from './actionTypes.js';\nimport { initEvent, doneInvoke, toActionObjects, resolveActions, error, getActionFunction } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { warn, mapContext, toObserver, isFunction, toSCXMLEvent, flatten, isRaisableAction, isPromiseLike, isObservable, isMachine, isBehavior, reportUnhandledExceptionOnInvocation, symbolObservable, isArray, toEventObject, isString, isActor, toInvokeSource, uniqueId } from './utils.js';\nimport { Scheduler } from './scheduler.js';\nimport { createDeferredActor, isSpawnedActor } from './Actor.js';\nimport { registry } from './registry.js';\nimport { getGlobal, registerService } from './devTools.js';\nimport { provide, consume } from './serviceScope.js';\nimport { spawnBehavior } from './behaviors.js';\n\nvar DEFAULT_SPAWN_OPTIONS = {\n sync: false,\n autoForward: false\n};\nvar InterpreterStatus;\n\n(function (InterpreterStatus) {\n InterpreterStatus[InterpreterStatus[\"NotStarted\"] = 0] = \"NotStarted\";\n InterpreterStatus[InterpreterStatus[\"Running\"] = 1] = \"Running\";\n InterpreterStatus[InterpreterStatus[\"Stopped\"] = 2] = \"Stopped\";\n})(InterpreterStatus || (InterpreterStatus = {}));\n\nvar Interpreter =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new Interpreter instance (i.e., service) for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to be interpreted\r\n * @param options Interpreter options\r\n */\n function Interpreter(machine, options) {\n if (options === void 0) {\n options = Interpreter.defaultOptions;\n }\n\n var _this = this;\n\n this.machine = machine;\n this.delayedEventsMap = {};\n this.listeners = new Set();\n this.contextListeners = new Set();\n this.stopListeners = new Set();\n this.doneListeners = new Set();\n this.eventListeners = new Set();\n this.sendListeners = new Set();\n /**\r\n * Whether the service is started.\r\n */\n\n this.initialized = false;\n this.status = InterpreterStatus.NotStarted;\n this.children = new Map();\n this.forwardTo = new Set();\n this._outgoingQueue = [];\n /**\r\n * Alias for Interpreter.prototype.start\r\n */\n\n this.init = this.start;\n /**\r\n * Sends an event to the running interpreter to trigger a transition.\r\n *\r\n * An array of events (batched) can be sent as well, which will send all\r\n * batched events to the running interpreter. The listeners will be\r\n * notified only **once** when all events are processed.\r\n *\r\n * @param event The event(s) to send\r\n */\n\n this.send = function (event, payload) {\n if (isArray(event)) {\n _this.batch(event);\n\n return _this.state;\n }\n\n var _event = toSCXMLEvent(toEventObject(event, payload));\n\n if (_this.status === InterpreterStatus.Stopped) {\n // do nothing\n if (!IS_PRODUCTION) {\n warn(false, \"Event \\\"\".concat(_event.name, \"\\\" was sent to stopped service \\\"\").concat(_this.machine.id, \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n return _this.state;\n }\n\n if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {\n throw new Error(\"Event \\\"\".concat(_event.name, \"\\\" was sent to uninitialized service \\\"\").concat(_this.machine.id // tslint:disable-next-line:max-line-length\n , \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n _this.scheduler.schedule(function () {\n // Forward copy of event to child actors\n _this.forward(_event);\n\n var nextState = _this._nextState(_event);\n\n _this.update(nextState, _event);\n });\n\n return _this._state; // TODO: deprecate (should return void)\n // tslint:disable-next-line:semicolon\n };\n\n this.sendTo = function (event, to, immediate) {\n var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n var target = isParent ? _this.parent : isString(to) ? to === SpecialTargets.Internal ? _this : _this.children.get(to) || registry.get(to) : isActor(to) ? to : undefined;\n\n if (!target) {\n if (!isParent) {\n throw new Error(\"Unable to send event to child '\".concat(to, \"' from service '\").concat(_this.id, \"'.\"));\n } // tslint:disable-next-line:no-console\n\n\n if (!IS_PRODUCTION) {\n warn(false, \"Service '\".concat(_this.id, \"' has no parent: unable to send event \").concat(event.type));\n }\n\n return;\n }\n\n if ('machine' in target) {\n // perhaps those events should be rejected in the parent\n // but atm it doesn't have easy access to all of the information that is required to do it reliably\n if (_this.status !== InterpreterStatus.Stopped || _this.parent !== target || // we need to send events to the parent from exit handlers of a machine that reached its final state\n _this.state.done) {\n // Send SCXML events to machines\n var scxmlEvent = __assign(__assign({}, event), {\n name: event.name === error$1 ? \"\".concat(error(_this.id)) : event.name,\n origin: _this.sessionId\n });\n\n if (!immediate && _this.machine.config.predictableActionArguments) {\n _this._outgoingQueue.push([target, scxmlEvent]);\n } else {\n target.send(scxmlEvent);\n }\n }\n } else {\n // Send normal events to other targets\n if (!immediate && _this.machine.config.predictableActionArguments) {\n _this._outgoingQueue.push([target, event.data]);\n } else {\n target.send(event.data);\n }\n }\n };\n\n this._exec = function (action, context, _event, actionFunctionMap) {\n if (actionFunctionMap === void 0) {\n actionFunctionMap = _this.machine.options.actions;\n }\n\n var actionOrExec = action.exec || getActionFunction(action.type, actionFunctionMap);\n var exec = isFunction(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;\n\n if (exec) {\n try {\n return exec(context, _event.data, !_this.machine.config.predictableActionArguments ? {\n action: action,\n state: _this.state,\n _event: _event\n } : {\n action: action,\n _event: _event\n });\n } catch (err) {\n if (_this.parent) {\n _this.parent.send({\n type: 'xstate.error',\n data: err\n });\n }\n\n throw err;\n }\n }\n\n switch (action.type) {\n case raise:\n {\n // if raise action reached the interpreter then it's a delayed one\n var sendAction_1 = action;\n\n _this.defer(sendAction_1);\n\n break;\n }\n\n case send:\n var sendAction = action;\n\n if (typeof sendAction.delay === 'number') {\n _this.defer(sendAction);\n\n return;\n } else {\n if (sendAction.to) {\n _this.sendTo(sendAction._event, sendAction.to, _event === initEvent);\n } else {\n _this.send(sendAction._event);\n }\n }\n\n break;\n\n case cancel:\n _this.cancel(action.sendId);\n\n break;\n\n case start:\n {\n if (_this.status !== InterpreterStatus.Running) {\n return;\n }\n\n var activity = action.activity; // If the activity will be stopped right after it's started\n // (such as in transient states)\n // don't bother starting the activity.\n\n if ( // in v4 with `predictableActionArguments` invokes are called eagerly when the `this.state` still points to the previous state\n !_this.machine.config.predictableActionArguments && !_this.state.activities[activity.id || activity.type]) {\n break;\n } // Invoked services\n\n\n if (activity.type === ActionTypes.Invoke) {\n var invokeSource = toInvokeSource(activity.src);\n var serviceCreator = _this.machine.options.services ? _this.machine.options.services[invokeSource.type] : undefined;\n var id = activity.id,\n data = activity.data;\n\n if (!IS_PRODUCTION) {\n warn(!('forward' in activity), // tslint:disable-next-line:max-line-length\n \"`forward` property is deprecated (found in invocation of '\".concat(activity.src, \"' in in machine '\").concat(_this.machine.id, \"'). \") + \"Please use `autoForward` instead.\");\n }\n\n var autoForward = 'autoForward' in activity ? activity.autoForward : !!activity.forward;\n\n if (!serviceCreator) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"No service found for invocation '\".concat(activity.src, \"' in machine '\").concat(_this.machine.id, \"'.\"));\n }\n\n return;\n }\n\n var resolvedData = data ? mapContext(data, context, _event) : undefined;\n\n if (typeof serviceCreator === 'string') {\n // TODO: warn\n return;\n }\n\n var source = isFunction(serviceCreator) ? serviceCreator(context, _event.data, {\n data: resolvedData,\n src: invokeSource,\n meta: activity.meta\n }) : serviceCreator;\n\n if (!source) {\n // TODO: warn?\n return;\n }\n\n var options = void 0;\n\n if (isMachine(source)) {\n source = resolvedData ? source.withContext(resolvedData) : source;\n options = {\n autoForward: autoForward\n };\n }\n\n _this.spawn(source, id, options);\n } else {\n _this.spawnActivity(activity);\n }\n\n break;\n }\n\n case stop:\n {\n _this.stopChild(action.activity.id);\n\n break;\n }\n\n case log:\n var _a = action,\n label = _a.label,\n value = _a.value;\n\n if (label) {\n _this.logger(label, value);\n } else {\n _this.logger(value);\n }\n\n break;\n\n default:\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for action type '\".concat(action.type, \"'\"));\n }\n\n break;\n }\n };\n\n var resolvedOptions = __assign(__assign({}, Interpreter.defaultOptions), options);\n\n var clock = resolvedOptions.clock,\n logger = resolvedOptions.logger,\n parent = resolvedOptions.parent,\n id = resolvedOptions.id;\n var resolvedId = id !== undefined ? id : machine.id;\n this.id = resolvedId;\n this.logger = logger;\n this.clock = clock;\n this.parent = parent;\n this.options = resolvedOptions;\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n this.sessionId = registry.bookId();\n }\n\n Object.defineProperty(Interpreter.prototype, \"initialState\", {\n get: function () {\n var _this = this;\n\n if (this._initialState) {\n return this._initialState;\n }\n\n return provide(this, function () {\n _this._initialState = _this.machine.initialState;\n return _this._initialState;\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Interpreter.prototype, \"state\", {\n /**\r\n * @deprecated Use `.getSnapshot()` instead.\r\n */\n get: function () {\n if (!IS_PRODUCTION) {\n warn(this.status !== InterpreterStatus.NotStarted, \"Attempted to read state from uninitialized service '\".concat(this.id, \"'. Make sure the service is started first.\"));\n }\n\n return this._state;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Executes the actions of the given state, with that state's `context` and `event`.\r\n *\r\n * @param state The state whose actions will be executed\r\n * @param actionsConfig The action implementations to use\r\n */\n\n Interpreter.prototype.execute = function (state, actionsConfig) {\n var e_1, _a;\n\n try {\n for (var _b = __values(state.actions), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n this.exec(action, state, actionsConfig);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n };\n\n Interpreter.prototype.update = function (state, _event) {\n var e_2, _a, e_3, _b, e_4, _c, e_5, _d;\n\n var _this = this; // Attach session ID to state\n\n\n state._sessionid = this.sessionId; // Update state\n\n this._state = state; // Execute actions\n\n if ((!this.machine.config.predictableActionArguments || // this is currently required to execute initial actions as the `initialState` gets cached\n // we can't just recompute it (and execute actions while doing so) because we try to preserve identity of actors created within initial assigns\n _event === initEvent) && this.options.execute) {\n this.execute(this.state);\n } else {\n var item = void 0;\n\n while (item = this._outgoingQueue.shift()) {\n item[0].send(item[1]);\n }\n } // Update children\n\n\n this.children.forEach(function (child) {\n _this.state.children[child.id] = child;\n }); // Dev tools\n\n if (this.devTools) {\n this.devTools.send(_event.data, state);\n } // Execute listeners\n\n\n if (state.event) {\n try {\n for (var _e = __values(this.eventListeners), _f = _e.next(); !_f.done; _f = _e.next()) {\n var listener = _f.value;\n listener(state.event);\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n\n try {\n for (var _g = __values(this.listeners), _h = _g.next(); !_h.done; _h = _g.next()) {\n var listener = _h.value;\n listener(state, state.event);\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n try {\n for (var _j = __values(this.contextListeners), _k = _j.next(); !_k.done; _k = _j.next()) {\n var contextListener = _k.value;\n contextListener(this.state.context, this.state.history ? this.state.history.context : undefined);\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (_k && !_k.done && (_c = _j.return)) _c.call(_j);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n if (this.state.done) {\n // get final child state node\n var finalChildStateNode = state.configuration.find(function (sn) {\n return sn.type === 'final' && sn.parent === _this.machine;\n });\n var doneData = finalChildStateNode && finalChildStateNode.doneData ? mapContext(finalChildStateNode.doneData, state.context, _event) : undefined;\n this._doneEvent = doneInvoke(this.id, doneData);\n\n try {\n for (var _l = __values(this.doneListeners), _m = _l.next(); !_m.done; _m = _l.next()) {\n var listener = _m.value;\n listener(this._doneEvent);\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_m && !_m.done && (_d = _l.return)) _d.call(_l);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n this._stop();\n\n this._stopChildren();\n\n registry.free(this.sessionId);\n }\n };\n /*\r\n * Adds a listener that is notified whenever a state transition happens. The listener is called with\r\n * the next state and the event object that caused the state transition.\r\n *\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onTransition = function (listener) {\n this.listeners.add(listener); // Send current state to listener\n\n if (this.status === InterpreterStatus.Running) {\n listener(this.state, this.state.event);\n }\n\n return this;\n };\n\n Interpreter.prototype.subscribe = function (nextListenerOrObserver, _, // TODO: error listener\n completeListener) {\n var _this = this;\n\n var observer = toObserver(nextListenerOrObserver, _, completeListener);\n this.listeners.add(observer.next); // Send current state to listener\n\n if (this.status !== InterpreterStatus.NotStarted) {\n observer.next(this.state);\n }\n\n var completeOnce = function () {\n _this.doneListeners.delete(completeOnce);\n\n _this.stopListeners.delete(completeOnce);\n\n observer.complete();\n };\n\n if (this.status === InterpreterStatus.Stopped) {\n observer.complete();\n } else {\n this.onDone(completeOnce);\n this.onStop(completeOnce);\n }\n\n return {\n unsubscribe: function () {\n _this.listeners.delete(observer.next);\n\n _this.doneListeners.delete(completeOnce);\n\n _this.stopListeners.delete(completeOnce);\n }\n };\n };\n /**\r\n * Adds an event listener that is notified whenever an event is sent to the running interpreter.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onEvent = function (listener) {\n this.eventListeners.add(listener);\n return this;\n };\n /**\r\n * Adds an event listener that is notified whenever a `send` event occurs.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onSend = function (listener) {\n this.sendListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a context listener that is notified whenever the state context changes.\r\n * @param listener The context listener\r\n */\n\n\n Interpreter.prototype.onChange = function (listener) {\n this.contextListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a listener that is notified when the machine is stopped.\r\n * @param listener The listener\r\n */\n\n\n Interpreter.prototype.onStop = function (listener) {\n this.stopListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a state listener that is notified when the statechart has reached its final state.\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onDone = function (listener) {\n if (this.status === InterpreterStatus.Stopped && this._doneEvent) {\n listener(this._doneEvent);\n } else {\n this.doneListeners.add(listener);\n }\n\n return this;\n };\n /**\r\n * Removes a listener.\r\n * @param listener The listener to remove\r\n */\n\n\n Interpreter.prototype.off = function (listener) {\n this.listeners.delete(listener);\n this.eventListeners.delete(listener);\n this.sendListeners.delete(listener);\n this.stopListeners.delete(listener);\n this.doneListeners.delete(listener);\n this.contextListeners.delete(listener);\n return this;\n };\n /**\r\n * Starts the interpreter from the given state, or the initial state.\r\n * @param initialState The state to start the statechart from\r\n */\n\n\n Interpreter.prototype.start = function (initialState) {\n var _this = this;\n\n if (this.status === InterpreterStatus.Running) {\n // Do not restart the service if it is already started\n return this;\n } // yes, it's a hack but we need the related cache to be populated for some things to work (like delayed transitions)\n // this is usually called by `machine.getInitialState` but if we rehydrate from a state we might bypass this call\n // we also don't want to call this method here as it resolves the full initial state which might involve calling assign actions\n // and that could potentially lead to some unwanted side-effects (even such as creating some rogue actors)\n\n\n this.machine._init();\n\n registry.register(this.sessionId, this);\n this.initialized = true;\n this.status = InterpreterStatus.Running;\n var resolvedState = initialState === undefined ? this.initialState : provide(this, function () {\n return isStateConfig(initialState) ? _this.machine.resolveState(initialState) : _this.machine.resolveState(State.from(initialState, _this.machine.context));\n });\n\n if (this.options.devTools) {\n this.attachDev();\n }\n\n this.scheduler.initialize(function () {\n _this.update(resolvedState, initEvent);\n });\n return this;\n };\n\n Interpreter.prototype._stopChildren = function () {\n // TODO: think about converting those to actions\n this.children.forEach(function (child) {\n if (isFunction(child.stop)) {\n child.stop();\n }\n });\n this.children.clear();\n };\n\n Interpreter.prototype._stop = function () {\n var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;\n\n try {\n for (var _f = __values(this.listeners), _g = _f.next(); !_g.done; _g = _f.next()) {\n var listener = _g.value;\n this.listeners.delete(listener);\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n try {\n for (var _h = __values(this.stopListeners), _j = _h.next(); !_j.done; _j = _h.next()) {\n var listener = _j.value; // call listener, then remove\n\n listener();\n this.stopListeners.delete(listener);\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n\n try {\n for (var _k = __values(this.contextListeners), _l = _k.next(); !_l.done; _l = _k.next()) {\n var listener = _l.value;\n this.contextListeners.delete(listener);\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n\n try {\n for (var _m = __values(this.doneListeners), _o = _m.next(); !_o.done; _o = _m.next()) {\n var listener = _o.value;\n this.doneListeners.delete(listener);\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (_o && !_o.done && (_d = _m.return)) _d.call(_m);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n\n if (!this.initialized) {\n // Interpreter already stopped; do nothing\n return this;\n }\n\n this.initialized = false;\n this.status = InterpreterStatus.Stopped;\n this._initialState = undefined;\n\n try {\n // we are going to stop within the current sync frame\n // so we can safely just cancel this here as nothing async should be fired anyway\n for (var _p = __values(Object.keys(this.delayedEventsMap)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n this.clock.clearTimeout(this.delayedEventsMap[key]);\n }\n } catch (e_10_1) {\n e_10 = {\n error: e_10_1\n };\n } finally {\n try {\n if (_q && !_q.done && (_e = _p.return)) _e.call(_p);\n } finally {\n if (e_10) throw e_10.error;\n }\n } // clear everything that might be enqueued\n\n\n this.scheduler.clear();\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n };\n /**\r\n * Stops the interpreter and unsubscribe all listeners.\r\n *\r\n * This will also notify the `onStop` listeners.\r\n */\n\n\n Interpreter.prototype.stop = function () {\n // TODO: add warning for stopping non-root interpreters\n var _this = this; // grab the current scheduler as it will be replaced in _stop\n\n\n var scheduler = this.scheduler;\n\n this._stop(); // let what is currently processed to be finished\n\n\n scheduler.schedule(function () {\n // it feels weird to handle this here but we need to handle this even slightly \"out of band\"\n var _event = toSCXMLEvent({\n type: 'xstate.stop'\n });\n\n var nextState = provide(_this, function () {\n var exitActions = flatten(__spreadArray([], __read(_this.state.configuration), false).sort(function (a, b) {\n return b.order - a.order;\n }).map(function (stateNode) {\n return toActionObjects(stateNode.onExit, _this.machine.options.actions);\n }));\n\n var _a = __read(resolveActions(_this.machine, _this.state, _this.state.context, _event, [{\n type: 'exit',\n actions: exitActions\n }], _this.machine.config.predictableActionArguments ? _this._exec : undefined, _this.machine.config.predictableActionArguments || _this.machine.config.preserveActionOrder), 2),\n resolvedActions = _a[0],\n updatedContext = _a[1];\n\n var newState = new State({\n value: _this.state.value,\n context: updatedContext,\n _event: _event,\n _sessionid: _this.sessionId,\n historyValue: undefined,\n history: _this.state,\n actions: resolvedActions.filter(function (action) {\n return !isRaisableAction(action);\n }),\n activities: {},\n events: [],\n configuration: [],\n transitions: [],\n children: {},\n done: _this.state.done,\n tags: _this.state.tags,\n machine: _this.machine\n });\n newState.changed = true;\n return newState;\n });\n\n _this.update(nextState, _event);\n\n _this._stopChildren();\n\n registry.free(_this.sessionId);\n });\n return this;\n };\n\n Interpreter.prototype.batch = function (events) {\n var _this = this;\n\n if (this.status === InterpreterStatus.NotStarted && this.options.deferEvents) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\" and are deferred. Make sure .start() is called for this service.\\nEvent: \").concat(JSON.stringify(event)));\n }\n } else if (this.status !== InterpreterStatus.Running) {\n throw new Error( // tslint:disable-next-line:max-line-length\n \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\"));\n }\n\n if (!events.length) {\n return;\n }\n\n var exec = !!this.machine.config.predictableActionArguments && this._exec;\n this.scheduler.schedule(function () {\n var e_11, _a;\n\n var nextState = _this.state;\n var batchChanged = false;\n var batchedActions = [];\n\n var _loop_1 = function (event_1) {\n var _event = toSCXMLEvent(event_1);\n\n _this.forward(_event);\n\n nextState = provide(_this, function () {\n return _this.machine.transition(nextState, _event, undefined, exec || undefined);\n });\n batchedActions.push.apply(batchedActions, __spreadArray([], __read(_this.machine.config.predictableActionArguments ? nextState.actions : nextState.actions.map(function (a) {\n return bindActionToState(a, nextState);\n })), false));\n batchChanged = batchChanged || !!nextState.changed;\n };\n\n try {\n for (var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {\n var event_1 = events_1_1.value;\n\n _loop_1(event_1);\n }\n } catch (e_11_1) {\n e_11 = {\n error: e_11_1\n };\n } finally {\n try {\n if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);\n } finally {\n if (e_11) throw e_11.error;\n }\n }\n\n nextState.changed = batchChanged;\n nextState.actions = batchedActions;\n\n _this.update(nextState, toSCXMLEvent(events[events.length - 1]));\n });\n };\n /**\r\n * Returns a send function bound to this interpreter instance.\r\n *\r\n * @param event The event to be sent by the sender.\r\n */\n\n\n Interpreter.prototype.sender = function (event) {\n return this.send.bind(this, event);\n };\n\n Interpreter.prototype._nextState = function (event, exec) {\n var _this = this;\n\n if (exec === void 0) {\n exec = !!this.machine.config.predictableActionArguments && this._exec;\n }\n\n var _event = toSCXMLEvent(event);\n\n if (_event.name.indexOf(errorPlatform) === 0 && !this.state.nextEvents.some(function (nextEvent) {\n return nextEvent.indexOf(errorPlatform) === 0;\n })) {\n throw _event.data.data;\n }\n\n var nextState = provide(this, function () {\n return _this.machine.transition(_this.state, _event, undefined, exec || undefined);\n });\n return nextState;\n };\n /**\r\n * Returns the next state given the interpreter's current state and the event.\r\n *\r\n * This is a pure method that does _not_ update the interpreter's state.\r\n *\r\n * @param event The event to determine the next state\r\n */\n\n\n Interpreter.prototype.nextState = function (event) {\n return this._nextState(event, false);\n };\n\n Interpreter.prototype.forward = function (event) {\n var e_12, _a;\n\n try {\n for (var _b = __values(this.forwardTo), _c = _b.next(); !_c.done; _c = _b.next()) {\n var id = _c.value;\n var child = this.children.get(id);\n\n if (!child) {\n throw new Error(\"Unable to forward event '\".concat(event, \"' from interpreter '\").concat(this.id, \"' to nonexistant child '\").concat(id, \"'.\"));\n }\n\n child.send(event);\n }\n } catch (e_12_1) {\n e_12 = {\n error: e_12_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_12) throw e_12.error;\n }\n }\n };\n\n Interpreter.prototype.defer = function (sendAction) {\n var _this = this;\n\n var timerId = this.clock.setTimeout(function () {\n if ('to' in sendAction && sendAction.to) {\n _this.sendTo(sendAction._event, sendAction.to, true);\n } else {\n _this.send(sendAction._event);\n }\n }, sendAction.delay);\n\n if (sendAction.id) {\n this.delayedEventsMap[sendAction.id] = timerId;\n }\n };\n\n Interpreter.prototype.cancel = function (sendId) {\n this.clock.clearTimeout(this.delayedEventsMap[sendId]);\n delete this.delayedEventsMap[sendId];\n };\n\n Interpreter.prototype.exec = function (action, state, actionFunctionMap) {\n if (actionFunctionMap === void 0) {\n actionFunctionMap = this.machine.options.actions;\n }\n\n this._exec(action, state.context, state._event, actionFunctionMap);\n };\n\n Interpreter.prototype.removeChild = function (childId) {\n var _a;\n\n this.children.delete(childId);\n this.forwardTo.delete(childId); // this.state might not exist at the time this is called,\n // such as when a child is added then removed while initializing the state\n\n (_a = this.state) === null || _a === void 0 ? true : delete _a.children[childId];\n };\n\n Interpreter.prototype.stopChild = function (childId) {\n var child = this.children.get(childId);\n\n if (!child) {\n return;\n }\n\n this.removeChild(childId);\n\n if (isFunction(child.stop)) {\n child.stop();\n }\n };\n\n Interpreter.prototype.spawn = function (entity, name, options) {\n if (this.status !== InterpreterStatus.Running) {\n return createDeferredActor(entity, name);\n }\n\n if (isPromiseLike(entity)) {\n return this.spawnPromise(Promise.resolve(entity), name);\n } else if (isFunction(entity)) {\n return this.spawnCallback(entity, name);\n } else if (isSpawnedActor(entity)) {\n return this.spawnActor(entity, name);\n } else if (isObservable(entity)) {\n return this.spawnObservable(entity, name);\n } else if (isMachine(entity)) {\n return this.spawnMachine(entity, __assign(__assign({}, options), {\n id: name\n }));\n } else if (isBehavior(entity)) {\n return this.spawnBehavior(entity, name);\n } else {\n throw new Error(\"Unable to spawn entity \\\"\".concat(name, \"\\\" of type \\\"\").concat(typeof entity, \"\\\".\"));\n }\n };\n\n Interpreter.prototype.spawnMachine = function (machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var childService = new Interpreter(machine, __assign(__assign({}, this.options), {\n parent: this,\n id: options.id || machine.id\n }));\n\n var resolvedOptions = __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), options);\n\n if (resolvedOptions.sync) {\n childService.onTransition(function (state) {\n _this.send(update, {\n state: state,\n id: childService.id\n });\n });\n }\n\n var actor = childService;\n this.children.set(childService.id, actor);\n\n if (resolvedOptions.autoForward) {\n this.forwardTo.add(childService.id);\n }\n\n childService.onDone(function (doneEvent) {\n _this.removeChild(childService.id);\n\n _this.send(toSCXMLEvent(doneEvent, {\n origin: childService.id\n }));\n }).start();\n return actor;\n };\n\n Interpreter.prototype.spawnBehavior = function (behavior, id) {\n var actorRef = spawnBehavior(behavior, {\n id: id,\n parent: this\n });\n this.children.set(id, actorRef);\n return actorRef;\n };\n\n Interpreter.prototype.spawnPromise = function (promise, id) {\n var _a;\n\n var _this = this;\n\n var canceled = false;\n var resolvedData;\n promise.then(function (response) {\n if (!canceled) {\n resolvedData = response;\n\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id, response), {\n origin: id\n }));\n }\n }, function (errorData) {\n if (!canceled) {\n _this.removeChild(id);\n\n var errorEvent = error(id, errorData);\n\n try {\n // Send \"error.platform.id\" to this (parent).\n _this.send(toSCXMLEvent(errorEvent, {\n origin: id\n }));\n } catch (error) {\n reportUnhandledExceptionOnInvocation(errorData, error, id);\n\n if (_this.devTools) {\n _this.devTools.send(errorEvent, _this.state);\n }\n\n if (_this.machine.strict) {\n // it would be better to always stop the state machine if unhandled\n // exception/promise rejection happens but because we don't want to\n // break existing code so enforce it on strict mode only especially so\n // because documentation says that onError is optional\n _this.stop();\n }\n }\n }\n });\n var actor = (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n var unsubscribed = false;\n promise.then(function (response) {\n if (unsubscribed) {\n return;\n }\n\n observer.next(response);\n\n if (unsubscribed) {\n return;\n }\n\n observer.complete();\n }, function (err) {\n if (unsubscribed) {\n return;\n }\n\n observer.error(err);\n });\n return {\n unsubscribe: function () {\n return unsubscribed = true;\n }\n };\n },\n stop: function () {\n canceled = true;\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return resolvedData;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnCallback = function (callback, id) {\n var _a;\n\n var _this = this;\n\n var canceled = false;\n var receivers = new Set();\n var listeners = new Set();\n var emitted;\n\n var receive = function (e) {\n emitted = e;\n listeners.forEach(function (listener) {\n return listener(e);\n });\n\n if (canceled) {\n return;\n }\n\n _this.send(toSCXMLEvent(e, {\n origin: id\n }));\n };\n\n var callbackStop;\n\n try {\n callbackStop = callback(receive, function (newListener) {\n receivers.add(newListener);\n });\n } catch (err) {\n this.send(error(id, err));\n }\n\n if (isPromiseLike(callbackStop)) {\n // it turned out to be an async function, can't reliably check this before calling `callback`\n // because transpiled async functions are not recognizable\n return this.spawnPromise(callbackStop, id);\n }\n\n var actor = (_a = {\n id: id,\n send: function (event) {\n return receivers.forEach(function (receiver) {\n return receiver(event);\n });\n },\n subscribe: function (next) {\n var observer = toObserver(next);\n listeners.add(observer.next);\n return {\n unsubscribe: function () {\n listeners.delete(observer.next);\n }\n };\n },\n stop: function () {\n canceled = true;\n\n if (isFunction(callbackStop)) {\n callbackStop();\n }\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return emitted;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnObservable = function (source, id) {\n var _a;\n\n var _this = this;\n\n var emitted;\n var subscription = source.subscribe(function (value) {\n emitted = value;\n\n _this.send(toSCXMLEvent(value, {\n origin: id\n }));\n }, function (err) {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(error(id, err), {\n origin: id\n }));\n }, function () {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id), {\n origin: id\n }));\n });\n var actor = (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n return source.subscribe(next, handleError, complete);\n },\n stop: function () {\n return subscription.unsubscribe();\n },\n getSnapshot: function () {\n return emitted;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActor = function (actor, name) {\n this.children.set(name, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActivity = function (activity) {\n var implementation = this.machine.options && this.machine.options.activities ? this.machine.options.activities[activity.type] : undefined;\n\n if (!implementation) {\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for activity '\".concat(activity.type, \"'\"));\n } // tslint:disable-next-line:no-console\n\n\n return;\n } // Start implementation\n\n\n var dispose = implementation(this.state.context, activity);\n this.spawnEffect(activity.id, dispose);\n };\n\n Interpreter.prototype.spawnEffect = function (id, dispose) {\n var _a;\n\n this.children.set(id, (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n stop: dispose || undefined,\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a));\n };\n\n Interpreter.prototype.attachDev = function () {\n var global = getGlobal();\n\n if (this.options.devTools && global) {\n if (global.__REDUX_DEVTOOLS_EXTENSION__) {\n var devToolsOptions = typeof this.options.devTools === 'object' ? this.options.devTools : undefined;\n this.devTools = global.__REDUX_DEVTOOLS_EXTENSION__.connect(__assign(__assign({\n name: this.id,\n autoPause: true,\n stateSanitizer: function (state) {\n return {\n value: state.value,\n context: state.context,\n actions: state.actions\n };\n }\n }, devToolsOptions), {\n features: __assign({\n jump: false,\n skip: false\n }, devToolsOptions ? devToolsOptions.features : undefined)\n }), this.machine);\n this.devTools.init(this.state);\n } // add XState-specific dev tooling hook\n\n\n registerService(this);\n }\n };\n\n Interpreter.prototype.toJSON = function () {\n return {\n id: this.id\n };\n };\n\n Interpreter.prototype[symbolObservable] = function () {\n return this;\n };\n\n Interpreter.prototype.getSnapshot = function () {\n if (this.status === InterpreterStatus.NotStarted) {\n return this.initialState;\n }\n\n return this._state;\n };\n /**\r\n * The default interpreter options:\r\n *\r\n * - `clock` uses the global `setTimeout` and `clearTimeout` functions\r\n * - `logger` uses the global `console.log()` method\r\n */\n\n\n Interpreter.defaultOptions = {\n execute: true,\n deferEvents: true,\n clock: {\n setTimeout: function (fn, ms) {\n return setTimeout(fn, ms);\n },\n clearTimeout: function (id) {\n return clearTimeout(id);\n }\n },\n logger: /*#__PURE__*/console.log.bind(console),\n devTools: false\n };\n Interpreter.interpret = interpret;\n return Interpreter;\n}();\n\nvar resolveSpawnOptions = function (nameOrOptions) {\n if (isString(nameOrOptions)) {\n return __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: nameOrOptions\n });\n }\n\n return __assign(__assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: uniqueId()\n }), nameOrOptions);\n};\n\nfunction spawn(entity, nameOrOptions) {\n var resolvedOptions = resolveSpawnOptions(nameOrOptions);\n return consume(function (service) {\n if (!IS_PRODUCTION) {\n var isLazyEntity = isMachine(entity) || isFunction(entity);\n warn(!!service || isLazyEntity, \"Attempted to spawn an Actor (ID: \\\"\".concat(isMachine(entity) ? entity.id : 'undefined', \"\\\") outside of a service. This will have no effect.\"));\n }\n\n if (service) {\n return service.spawn(entity, resolvedOptions.name, resolvedOptions);\n } else {\n return createDeferredActor(entity, resolvedOptions.name);\n }\n });\n}\n/**\r\n * Creates a new Interpreter instance for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to interpret\r\n * @param options Interpreter options\r\n */\n\nfunction interpret(machine, options) {\n var interpreter = new Interpreter(machine, options);\n return interpreter;\n}\n\nexport { Interpreter, InterpreterStatus, interpret, spawn };\n","import { __assign, __rest } from './_virtual/_tslib.js';\nimport './types.js';\nimport { invoke } from './actionTypes.js';\nimport './utils.js';\nimport './environment.js';\n\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n var simpleSrc = {\n type: src\n };\n\n simpleSrc.toString = function () {\n return src;\n }; // v4 compat - TODO: remove in v5\n\n\n return simpleSrc;\n }\n\n return src;\n}\nfunction toInvokeDefinition(invokeConfig) {\n return __assign(__assign({\n type: invoke\n }, invokeConfig), {\n toJSON: function () {\n invokeConfig.onDone;\n invokeConfig.onError;\n var invokeDef = __rest(invokeConfig, [\"onDone\", \"onError\"]);\n\n return __assign(__assign({}, invokeDef), {\n type: invoke,\n src: toInvokeSource(invokeConfig.src)\n });\n }\n });\n}\n\nexport { toInvokeDefinition, toInvokeSource };\n","import { __assign, __spreadArray, __read, __values, __rest } from './_virtual/_tslib.js';\nimport { isFunction, mapValues, isArray, flatten, toArray, toStateValue, isString, getEventType, toSCXMLEvent, matchesState, path, evaluateGuard, mapContext, isRaisableAction, pathToStateValue, isBuiltInEvent, partition, updateHistoryValue, toStatePath, mapFilterValues, warn, toStatePaths, nestedPath, normalizeTarget, toGuard, toTransitionConfigArray, isMachine, createInvokeId } from './utils.js';\nimport { State, stateValuesEqual } from './State.js';\nimport { start as start$1, stop as stop$1, invoke, update, nullEvent } from './actionTypes.js';\nimport { done, start, toActionObjects, raise, stop, resolveActions, doneInvoke, error, toActionObject, toActivityDefinition, after, send, cancel, initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { STATE_DELIMITER } from './constants.js';\nimport { getAllStateNodes, getConfiguration, isInFinalState, getTagsFromConfiguration, has, getChildren, getValue, isLeafNode, getAllChildren } from './stateUtils.js';\nimport { createInvocableActor } from './Actor.js';\nimport { toInvokeDefinition } from './invokeUtils.js';\n\nvar NULL_EVENT = '';\nvar STATE_IDENTIFIER = '#';\nvar WILDCARD = '*';\nvar EMPTY_OBJECT = {};\n\nvar isStateId = function (str) {\n return str[0] === STATE_IDENTIFIER;\n};\n\nvar createDefaultOptions = function () {\n return {\n actions: {},\n guards: {},\n services: {},\n activities: {},\n delays: {}\n };\n};\n\nvar validateArrayifiedTransitions = function (stateNode, event, transitions) {\n var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function (transition) {\n return !('cond' in transition) && !('in' in transition) && (isString(transition.target) || isMachine(transition.target));\n });\n var eventText = event === NULL_EVENT ? 'the transient event' : \"event '\".concat(event, \"'\");\n warn(!hasNonLastUnguardedTarget, \"One or more transitions for \".concat(eventText, \" on state '\").concat(stateNode.id, \"' are unreachable. \") + \"Make sure that the default transition is the last one defined.\");\n};\n\nvar StateNode =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function StateNode(\n /**\r\n * The raw config used to create the machine.\r\n */\n config, options,\n /**\r\n * The initial extended state\r\n */\n _context, // TODO: this is unsafe, but we're removing it in v5 anyway\n _stateInfo) {\n if (_context === void 0) {\n _context = 'context' in config ? config.context : undefined;\n }\n\n var _this = this;\n\n var _a;\n\n this.config = config;\n this._context = _context;\n /**\r\n * The order this state node appears. Corresponds to the implicit SCXML document order.\r\n */\n\n this.order = -1;\n this.__xstatenode = true;\n this.__cache = {\n events: undefined,\n relativeValue: new Map(),\n initialStateValue: undefined,\n initialState: undefined,\n on: undefined,\n transitions: undefined,\n candidates: {},\n delayedTransitions: undefined\n };\n this.idMap = {};\n this.tags = [];\n this.options = Object.assign(createDefaultOptions(), options);\n this.parent = _stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.parent;\n this.key = this.config.key || (_stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.key) || this.config.id || '(machine)';\n this.machine = this.parent ? this.parent.machine : this;\n this.path = this.parent ? this.parent.path.concat(this.key) : [];\n this.delimiter = this.config.delimiter || (this.parent ? this.parent.delimiter : STATE_DELIMITER);\n this.id = this.config.id || __spreadArray([this.machine.key], __read(this.path), false).join(this.delimiter);\n this.version = this.parent ? this.parent.version : this.config.version;\n this.type = this.config.type || (this.config.parallel ? 'parallel' : this.config.states && Object.keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');\n this.schema = this.parent ? this.machine.schema : (_a = this.config.schema) !== null && _a !== void 0 ? _a : {};\n this.description = this.config.description;\n\n if (!IS_PRODUCTION) {\n warn(!('parallel' in this.config), \"The \\\"parallel\\\" property is deprecated and will be removed in version 4.1. \".concat(this.config.parallel ? \"Replace with `type: 'parallel'`\" : \"Use `type: '\".concat(this.type, \"'`\"), \" in the config for state node '\").concat(this.id, \"' instead.\"));\n }\n\n this.initial = this.config.initial;\n this.states = this.config.states ? mapValues(this.config.states, function (stateConfig, key) {\n var _a;\n\n var stateNode = new StateNode(stateConfig, {}, undefined, {\n parent: _this,\n key: key\n });\n Object.assign(_this.idMap, __assign((_a = {}, _a[stateNode.id] = stateNode, _a), stateNode.idMap));\n return stateNode;\n }) : EMPTY_OBJECT; // Document order\n\n var order = 0;\n\n function dfs(stateNode) {\n var e_1, _a;\n\n stateNode.order = order++;\n\n try {\n for (var _b = __values(getAllChildren(stateNode)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n dfs(child);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n }\n\n dfs(this); // History config\n\n this.history = this.config.history === true ? 'shallow' : this.config.history || false;\n this._transient = !!this.config.always || (!this.config.on ? false : Array.isArray(this.config.on) ? this.config.on.some(function (_a) {\n var event = _a.event;\n return event === NULL_EVENT;\n }) : NULL_EVENT in this.config.on);\n this.strict = !!this.config.strict; // TODO: deprecate (entry)\n\n this.onEntry = toArray(this.config.entry || this.config.onEntry).map(function (action) {\n return toActionObject(action);\n }); // TODO: deprecate (exit)\n\n this.onExit = toArray(this.config.exit || this.config.onExit).map(function (action) {\n return toActionObject(action);\n });\n this.meta = this.config.meta;\n this.doneData = this.type === 'final' ? this.config.data : undefined;\n this.invoke = toArray(this.config.invoke).map(function (invokeConfig, i) {\n var _a, _b;\n\n if (isMachine(invokeConfig)) {\n var invokeId = createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_a = {}, _a[invokeId] = invokeConfig, _a), _this.machine.options.services);\n return toInvokeDefinition({\n src: invokeId,\n id: invokeId\n });\n } else if (isString(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n return toInvokeDefinition(__assign(__assign({}, invokeConfig), {\n id: invokeId,\n src: invokeConfig.src\n }));\n } else if (isMachine(invokeConfig.src) || isFunction(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_b = {}, _b[invokeId] = invokeConfig.src, _b), _this.machine.options.services);\n return toInvokeDefinition(__assign(__assign({\n id: invokeId\n }, invokeConfig), {\n src: invokeId\n }));\n } else {\n var invokeSource = invokeConfig.src;\n return toInvokeDefinition(__assign(__assign({\n id: createInvokeId(_this.id, i)\n }, invokeConfig), {\n src: invokeSource\n }));\n }\n });\n this.activities = toArray(this.config.activities).concat(this.invoke).map(function (activity) {\n return toActivityDefinition(activity);\n });\n this.transition = this.transition.bind(this);\n this.tags = toArray(this.config.tags); // TODO: this is the real fix for initialization once\n // state node getters are deprecated\n // if (!this.parent) {\n // this._init();\n // }\n }\n\n StateNode.prototype._init = function () {\n if (this.__cache.transitions) {\n return;\n }\n\n getAllStateNodes(this).forEach(function (stateNode) {\n return stateNode.on;\n });\n };\n /**\r\n * Clones this state machine with custom options and context.\r\n *\r\n * @param options Options (actions, guards, activities, services) to recursively merge with the existing options.\r\n * @param context Custom context (will override predefined context)\r\n */\n\n\n StateNode.prototype.withConfig = function (options, context) {\n var _a = this.options,\n actions = _a.actions,\n activities = _a.activities,\n guards = _a.guards,\n services = _a.services,\n delays = _a.delays;\n return new StateNode(this.config, {\n actions: __assign(__assign({}, actions), options.actions),\n activities: __assign(__assign({}, activities), options.activities),\n guards: __assign(__assign({}, guards), options.guards),\n services: __assign(__assign({}, services), options.services),\n delays: __assign(__assign({}, delays), options.delays)\n }, context !== null && context !== void 0 ? context : this.context);\n };\n /**\r\n * Clones this state machine with custom context.\r\n *\r\n * @param context Custom context (will override predefined context, not recursive)\r\n */\n\n\n StateNode.prototype.withContext = function (context) {\n return new StateNode(this.config, this.options, context);\n };\n\n Object.defineProperty(StateNode.prototype, \"context\", {\n get: function () {\n return isFunction(this._context) ? this._context() : this._context;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"definition\", {\n /**\r\n * The well-structured state node definition.\r\n */\n get: function () {\n return {\n id: this.id,\n key: this.key,\n version: this.version,\n context: this.context,\n type: this.type,\n initial: this.initial,\n history: this.history,\n states: mapValues(this.states, function (state) {\n return state.definition;\n }),\n on: this.on,\n transitions: this.transitions,\n entry: this.onEntry,\n exit: this.onExit,\n activities: this.activities || [],\n meta: this.meta,\n order: this.order || -1,\n data: this.doneData,\n invoke: this.invoke,\n description: this.description,\n tags: this.tags\n };\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.toJSON = function () {\n return this.definition;\n };\n\n Object.defineProperty(StateNode.prototype, \"on\", {\n /**\r\n * The mapping of events to transitions.\r\n */\n get: function () {\n if (this.__cache.on) {\n return this.__cache.on;\n }\n\n var transitions = this.transitions;\n return this.__cache.on = transitions.reduce(function (map, transition) {\n map[transition.eventType] = map[transition.eventType] || [];\n map[transition.eventType].push(transition);\n return map;\n }, {});\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"after\", {\n get: function () {\n return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"transitions\", {\n /**\r\n * All the transitions that can be taken from this state node.\r\n */\n get: function () {\n return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getCandidates = function (eventName) {\n if (this.__cache.candidates[eventName]) {\n return this.__cache.candidates[eventName];\n }\n\n var transient = eventName === NULL_EVENT;\n var candidates = this.transitions.filter(function (transition) {\n var sameEventType = transition.eventType === eventName; // null events should only match against eventless transitions\n\n return transient ? sameEventType : sameEventType || transition.eventType === WILDCARD;\n });\n this.__cache.candidates[eventName] = candidates;\n return candidates;\n };\n /**\r\n * All delayed transitions from the config.\r\n */\n\n\n StateNode.prototype.getDelayedTransitions = function () {\n var _this = this;\n\n var afterConfig = this.config.after;\n\n if (!afterConfig) {\n return [];\n }\n\n var mutateEntryExit = function (delay, i) {\n var delayRef = isFunction(delay) ? \"\".concat(_this.id, \":delay[\").concat(i, \"]\") : delay;\n var eventType = after(delayRef, _this.id);\n\n _this.onEntry.push(send(eventType, {\n delay: delay\n }));\n\n _this.onExit.push(cancel(eventType));\n\n return eventType;\n };\n\n var delayedTransitions = isArray(afterConfig) ? afterConfig.map(function (transition, i) {\n var eventType = mutateEntryExit(transition.delay, i);\n return __assign(__assign({}, transition), {\n event: eventType\n });\n }) : flatten(Object.keys(afterConfig).map(function (delay, i) {\n var configTransition = afterConfig[delay];\n var resolvedTransition = isString(configTransition) ? {\n target: configTransition\n } : configTransition;\n var resolvedDelay = !isNaN(+delay) ? +delay : delay;\n var eventType = mutateEntryExit(resolvedDelay, i);\n return toArray(resolvedTransition).map(function (transition) {\n return __assign(__assign({}, transition), {\n event: eventType,\n delay: resolvedDelay\n });\n });\n }));\n return delayedTransitions.map(function (delayedTransition) {\n var delay = delayedTransition.delay;\n return __assign(__assign({}, _this.formatTransition(delayedTransition)), {\n delay: delay\n });\n });\n };\n /**\r\n * Returns the state nodes represented by the current state value.\r\n *\r\n * @param state The state value or State instance\r\n */\n\n\n StateNode.prototype.getStateNodes = function (state) {\n var _a;\n\n var _this = this;\n\n if (!state) {\n return [];\n }\n\n var stateValue = state instanceof State ? state.value : toStateValue(state, this.delimiter);\n\n if (isString(stateValue)) {\n var initialStateValue = this.getStateNode(stateValue).initial;\n return initialStateValue !== undefined ? this.getStateNodes((_a = {}, _a[stateValue] = initialStateValue, _a)) : [this, this.states[stateValue]];\n }\n\n var subStateKeys = Object.keys(stateValue);\n var subStateNodes = [this];\n subStateNodes.push.apply(subStateNodes, __spreadArray([], __read(flatten(subStateKeys.map(function (subStateKey) {\n return _this.getStateNode(subStateKey).getStateNodes(stateValue[subStateKey]);\n }))), false));\n return subStateNodes;\n };\n /**\r\n * Returns `true` if this state node explicitly handles the given event.\r\n *\r\n * @param event The event in question\r\n */\n\n\n StateNode.prototype.handles = function (event) {\n var eventType = getEventType(event);\n return this.events.includes(eventType);\n };\n /**\r\n * Resolves the given `state` to a new `State` instance relative to this machine.\r\n *\r\n * This ensures that `.events` and `.nextEvents` represent the correct values.\r\n *\r\n * @param state The state to resolve\r\n */\n\n\n StateNode.prototype.resolveState = function (state) {\n var stateFromConfig = state instanceof State ? state : State.create(state);\n var configuration = Array.from(getConfiguration([], this.getStateNodes(stateFromConfig.value)));\n return new State(__assign(__assign({}, stateFromConfig), {\n value: this.resolve(stateFromConfig.value),\n configuration: configuration,\n done: isInFinalState(configuration, this),\n tags: getTagsFromConfiguration(configuration),\n machine: this.machine\n }));\n };\n\n StateNode.prototype.transitionLeafNode = function (stateValue, state, _event) {\n var stateNode = this.getStateNode(stateValue);\n var next = stateNode.next(state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionCompoundNode = function (stateValue, state, _event) {\n var subStateKeys = Object.keys(stateValue);\n var stateNode = this.getStateNode(subStateKeys[0]);\n\n var next = stateNode._transition(stateValue[subStateKeys[0]], state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionParallelNode = function (stateValue, state, _event) {\n var e_2, _a;\n\n var transitionMap = {};\n\n try {\n for (var _b = __values(Object.keys(stateValue)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var subStateKey = _c.value;\n var subStateValue = stateValue[subStateKey];\n\n if (!subStateValue) {\n continue;\n }\n\n var subStateNode = this.getStateNode(subStateKey);\n\n var next = subStateNode._transition(subStateValue, state, _event);\n\n if (next) {\n transitionMap[subStateKey] = next;\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n var stateTransitions = Object.keys(transitionMap).map(function (key) {\n return transitionMap[key];\n });\n var enabledTransitions = flatten(stateTransitions.map(function (st) {\n return st.transitions;\n }));\n var willTransition = stateTransitions.some(function (st) {\n return st.transitions.length > 0;\n });\n\n if (!willTransition) {\n return this.next(state, _event);\n }\n\n var configuration = flatten(Object.keys(transitionMap).map(function (key) {\n return transitionMap[key].configuration;\n }));\n return {\n transitions: enabledTransitions,\n exitSet: flatten(stateTransitions.map(function (t) {\n return t.exitSet;\n })),\n configuration: configuration,\n source: state,\n actions: flatten(Object.keys(transitionMap).map(function (key) {\n return transitionMap[key].actions;\n }))\n };\n };\n\n StateNode.prototype._transition = function (stateValue, state, _event) {\n // leaf node\n if (isString(stateValue)) {\n return this.transitionLeafNode(stateValue, state, _event);\n } // hierarchical node\n\n\n if (Object.keys(stateValue).length === 1) {\n return this.transitionCompoundNode(stateValue, state, _event);\n } // orthogonal node\n\n\n return this.transitionParallelNode(stateValue, state, _event);\n };\n\n StateNode.prototype.getTransitionData = function (state, event) {\n return this._transition(state.value, state, toSCXMLEvent(event));\n };\n\n StateNode.prototype.next = function (state, _event) {\n var e_3, _a;\n\n var _this = this;\n\n var eventName = _event.name;\n var actions = [];\n var nextStateNodes = [];\n var selectedTransition;\n\n try {\n for (var _b = __values(this.getCandidates(eventName)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var candidate = _c.value;\n var cond = candidate.cond,\n stateIn = candidate.in;\n var resolvedContext = state.context;\n var isInState = stateIn ? isString(stateIn) && isStateId(stateIn) ? // Check if in state by ID\n state.matches(toStateValue(this.getStateNodeById(stateIn).path, this.delimiter)) : // Check if in state by relative grandparent\n matchesState(toStateValue(stateIn, this.delimiter), path(this.path.slice(0, -2))(state.value)) : true;\n var guardPassed = false;\n\n try {\n guardPassed = !cond || evaluateGuard(this.machine, cond, resolvedContext, _event, state);\n } catch (err) {\n throw new Error(\"Unable to evaluate guard '\".concat(cond.name || cond.type, \"' in transition for event '\").concat(eventName, \"' in state node '\").concat(this.id, \"':\\n\").concat(err.message));\n }\n\n if (guardPassed && isInState) {\n if (candidate.target !== undefined) {\n nextStateNodes = candidate.target;\n }\n\n actions.push.apply(actions, __spreadArray([], __read(candidate.actions), false));\n selectedTransition = candidate;\n break;\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n if (!selectedTransition) {\n return undefined;\n }\n\n if (!nextStateNodes.length) {\n return {\n transitions: [selectedTransition],\n exitSet: [],\n configuration: state.value ? [this] : [],\n source: state,\n actions: actions\n };\n }\n\n var allNextStateNodes = flatten(nextStateNodes.map(function (stateNode) {\n return _this.getRelativeStateNodes(stateNode, state.historyValue);\n }));\n var isInternal = !!selectedTransition.internal;\n return {\n transitions: [selectedTransition],\n exitSet: isInternal ? [] : flatten(nextStateNodes.map(function (targetNode) {\n return _this.getPotentiallyReenteringNodes(targetNode);\n })),\n configuration: allNextStateNodes,\n source: state,\n actions: actions\n };\n }; // even though the name of this function mentions reentry nodes\n // we are pushing its result into `exitSet`\n // that's because what we exit might be reentered (it's an invariant of reentrancy)\n\n\n StateNode.prototype.getPotentiallyReenteringNodes = function (targetNode) {\n if (this.order < targetNode.order) {\n return [this];\n }\n\n var nodes = [];\n var marker = this;\n var possibleAncestor = targetNode;\n\n while (marker && marker !== possibleAncestor) {\n nodes.push(marker);\n marker = marker.parent;\n }\n\n if (marker !== possibleAncestor) {\n // we never got to `possibleAncestor`, therefore the initial `marker` \"escapes\" it\n // it's in a different part of the tree so no states will be reentered for such an external transition\n return [];\n }\n\n nodes.push(possibleAncestor);\n return nodes;\n };\n\n StateNode.prototype.getActions = function (resolvedConfig, isDone, transition, currentContext, _event, prevState, predictableExec) {\n var e_4, _a, e_5, _b;\n\n var _this = this;\n\n var prevConfig = prevState ? getConfiguration([], this.getStateNodes(prevState.value)) : [];\n var entrySet = new Set();\n\n try {\n for (var _c = __values(Array.from(resolvedConfig).sort(function (a, b) {\n return a.order - b.order;\n })), _d = _c.next(); !_d.done; _d = _c.next()) {\n var sn = _d.value;\n\n if (!has(prevConfig, sn) || has(transition.exitSet, sn) || sn.parent && entrySet.has(sn.parent)) {\n entrySet.add(sn);\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n try {\n for (var prevConfig_1 = __values(prevConfig), prevConfig_1_1 = prevConfig_1.next(); !prevConfig_1_1.done; prevConfig_1_1 = prevConfig_1.next()) {\n var sn = prevConfig_1_1.value;\n\n if (!has(resolvedConfig, sn) || has(transition.exitSet, sn.parent)) {\n transition.exitSet.push(sn);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (prevConfig_1_1 && !prevConfig_1_1.done && (_b = prevConfig_1.return)) _b.call(prevConfig_1);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n transition.exitSet.sort(function (a, b) {\n return b.order - a.order;\n });\n var entryStates = Array.from(entrySet).sort(function (a, b) {\n return a.order - b.order;\n });\n var exitStates = new Set(transition.exitSet);\n var doneEvents = flatten(entryStates.map(function (sn) {\n var events = [];\n\n if (sn.type !== 'final') {\n return events;\n }\n\n var parent = sn.parent;\n\n if (!parent.parent) {\n return events;\n }\n\n events.push(done(sn.id, sn.doneData), // TODO: deprecate - final states should not emit done events for their own state.\n done(parent.id, sn.doneData ? mapContext(sn.doneData, currentContext, _event) : undefined));\n var grandparent = parent.parent;\n\n if (grandparent.type === 'parallel') {\n if (getChildren(grandparent).every(function (parentNode) {\n return isInFinalState(transition.configuration, parentNode);\n })) {\n events.push(done(grandparent.id));\n }\n }\n\n return events;\n }));\n var entryActions = entryStates.map(function (stateNode) {\n var entryActions = stateNode.onEntry;\n var invokeActions = stateNode.activities.map(function (activity) {\n return start(activity);\n });\n return {\n type: 'entry',\n actions: toActionObjects(predictableExec ? __spreadArray(__spreadArray([], __read(entryActions), false), __read(invokeActions), false) : __spreadArray(__spreadArray([], __read(invokeActions), false), __read(entryActions), false), _this.machine.options.actions)\n };\n }).concat({\n type: 'state_done',\n actions: doneEvents.map(function (event) {\n return raise(event);\n })\n });\n var exitActions = Array.from(exitStates).map(function (stateNode) {\n return {\n type: 'exit',\n actions: toActionObjects(__spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function (activity) {\n return stop(activity);\n })), false), _this.machine.options.actions)\n };\n });\n var actions = exitActions.concat({\n type: 'transition',\n actions: toActionObjects(transition.actions, this.machine.options.actions)\n }).concat(entryActions);\n\n if (isDone) {\n var stopActions = toActionObjects(flatten(__spreadArray([], __read(resolvedConfig), false).sort(function (a, b) {\n return b.order - a.order;\n }).map(function (stateNode) {\n return stateNode.onExit;\n })), this.machine.options.actions).filter(function (action) {\n return !isRaisableAction(action);\n });\n return actions.concat({\n type: 'stop',\n actions: stopActions\n });\n }\n\n return actions;\n };\n /**\r\n * Determines the next state given the current `state` and sent `event`.\r\n *\r\n * @param state The current State instance or state value\r\n * @param event The event that was sent at the current state\r\n * @param context The current context (extended state) of the current state\r\n */\n\n\n StateNode.prototype.transition = function (state, event, context, exec) {\n if (state === void 0) {\n state = this.initialState;\n }\n\n var _event = toSCXMLEvent(event);\n\n var currentState;\n\n if (state instanceof State) {\n currentState = context === undefined ? state : this.resolveState(State.from(state, context));\n } else {\n var resolvedStateValue = isString(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);\n var resolvedContext = context !== null && context !== void 0 ? context : this.machine.context;\n currentState = this.resolveState(State.from(resolvedStateValue, resolvedContext));\n }\n\n if (!IS_PRODUCTION && _event.name === WILDCARD) {\n throw new Error(\"An event cannot have the wildcard type ('\".concat(WILDCARD, \"')\"));\n }\n\n if (this.strict) {\n if (!this.events.includes(_event.name) && !isBuiltInEvent(_event.name)) {\n throw new Error(\"Machine '\".concat(this.id, \"' does not accept event '\").concat(_event.name, \"'\"));\n }\n }\n\n var stateTransition = this._transition(currentState.value, currentState, _event) || {\n transitions: [],\n configuration: [],\n exitSet: [],\n source: currentState,\n actions: []\n };\n var prevConfig = getConfiguration([], this.getStateNodes(currentState.value));\n var resolvedConfig = stateTransition.configuration.length ? getConfiguration(prevConfig, stateTransition.configuration) : prevConfig;\n stateTransition.configuration = __spreadArray([], __read(resolvedConfig), false);\n return this.resolveTransition(stateTransition, currentState, currentState.context, exec, _event);\n };\n\n StateNode.prototype.resolveRaisedTransition = function (state, _event, originalEvent, predictableExec) {\n var _a;\n\n var currentActions = state.actions;\n state = this.transition(state, _event, undefined, predictableExec); // Save original event to state\n // TODO: this should be the raised event! Delete in V5 (breaking)\n\n state._event = originalEvent;\n state.event = originalEvent.data;\n\n (_a = state.actions).unshift.apply(_a, __spreadArray([], __read(currentActions), false));\n\n return state;\n };\n\n StateNode.prototype.resolveTransition = function (stateTransition, currentState, context, predictableExec, _event) {\n var e_6, _a, e_7, _b;\n\n var _this = this;\n\n if (_event === void 0) {\n _event = initEvent;\n }\n\n var configuration = stateTransition.configuration; // Transition will \"apply\" if:\n // - this is the initial state (there is no current state)\n // - OR there are transitions\n\n var willTransition = !currentState || stateTransition.transitions.length > 0;\n var resolvedConfiguration = willTransition ? stateTransition.configuration : currentState ? currentState.configuration : [];\n var isDone = isInFinalState(resolvedConfiguration, this);\n var resolvedStateValue = willTransition ? getValue(this.machine, configuration) : undefined;\n var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : undefined : undefined;\n var actionBlocks = this.getActions(new Set(resolvedConfiguration), isDone, stateTransition, context, _event, currentState, predictableExec);\n var activities = currentState ? __assign({}, currentState.activities) : {};\n\n try {\n for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {\n var block = actionBlocks_1_1.value;\n\n try {\n for (var _c = (e_7 = void 0, __values(block.actions)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var action = _d.value;\n\n if (action.type === start$1) {\n activities[action.activity.id || action.activity.type] = action;\n } else if (action.type === stop$1) {\n activities[action.activity.id || action.activity.type] = false;\n }\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n var _e = __read(resolveActions(this, currentState, context, _event, actionBlocks, predictableExec, this.machine.config.predictableActionArguments || this.machine.config.preserveActionOrder), 2),\n resolvedActions = _e[0],\n updatedContext = _e[1];\n\n var _f = __read(partition(resolvedActions, isRaisableAction), 2),\n raisedEvents = _f[0],\n nonRaisedActions = _f[1];\n\n var invokeActions = resolvedActions.filter(function (action) {\n var _a;\n\n return action.type === start$1 && ((_a = action.activity) === null || _a === void 0 ? void 0 : _a.type) === invoke;\n });\n var children = invokeActions.reduce(function (acc, action) {\n acc[action.activity.id] = createInvocableActor(action.activity, _this.machine, updatedContext, _event);\n return acc;\n }, currentState ? __assign({}, currentState.children) : {});\n var nextState = new State({\n value: resolvedStateValue || currentState.value,\n context: updatedContext,\n _event: _event,\n // Persist _sessionid between states\n _sessionid: currentState ? currentState._sessionid : null,\n historyValue: resolvedStateValue ? historyValue ? updateHistoryValue(historyValue, resolvedStateValue) : undefined : currentState ? currentState.historyValue : undefined,\n history: !resolvedStateValue || stateTransition.source ? currentState : undefined,\n actions: resolvedStateValue ? nonRaisedActions : [],\n activities: resolvedStateValue ? activities : currentState ? currentState.activities : {},\n events: [],\n configuration: resolvedConfiguration,\n transitions: stateTransition.transitions,\n children: children,\n done: isDone,\n tags: getTagsFromConfiguration(resolvedConfiguration),\n machine: this\n });\n var didUpdateContext = context !== updatedContext;\n nextState.changed = _event.name === update || didUpdateContext; // Dispose of penultimate histories to prevent memory leaks\n\n var history = nextState.history;\n\n if (history) {\n delete history.history;\n } // There are transient transitions if the machine is not in a final state\n // and if some of the state nodes have transient (\"always\") transitions.\n\n\n var hasAlwaysTransitions = !isDone && (this._transient || configuration.some(function (stateNode) {\n return stateNode._transient;\n })); // If there are no enabled transitions, check if there are transient transitions.\n // If there are transient transitions, continue checking for more transitions\n // because an transient transition should be triggered even if there are no\n // enabled transitions.\n //\n // If we're already working on an transient transition then stop to prevent an infinite loop.\n //\n // Otherwise, if there are no enabled nor transient transitions, we are done.\n\n if (!willTransition && (!hasAlwaysTransitions || _event.name === NULL_EVENT)) {\n return nextState;\n }\n\n var maybeNextState = nextState;\n\n if (!isDone) {\n if (hasAlwaysTransitions) {\n maybeNextState = this.resolveRaisedTransition(maybeNextState, {\n type: nullEvent\n }, _event, predictableExec);\n }\n\n while (raisedEvents.length) {\n var raisedEvent = raisedEvents.shift();\n maybeNextState = this.resolveRaisedTransition(maybeNextState, raisedEvent._event, _event, predictableExec);\n }\n } // Detect if state changed\n\n\n var changed = maybeNextState.changed || (history ? !!maybeNextState.actions.length || didUpdateContext || typeof history.value !== typeof maybeNextState.value || !stateValuesEqual(maybeNextState.value, history.value) : undefined);\n maybeNextState.changed = changed; // Preserve original history after raised events\n\n maybeNextState.history = history;\n return maybeNextState;\n };\n /**\r\n * Returns the child state node from its relative `stateKey`, or throws.\r\n */\n\n\n StateNode.prototype.getStateNode = function (stateKey) {\n if (isStateId(stateKey)) {\n return this.machine.getStateNodeById(stateKey);\n }\n\n if (!this.states) {\n throw new Error(\"Unable to retrieve child state '\".concat(stateKey, \"' from '\").concat(this.id, \"'; no child states exist.\"));\n }\n\n var result = this.states[stateKey];\n\n if (!result) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return result;\n };\n /**\r\n * Returns the state node with the given `stateId`, or throws.\r\n *\r\n * @param stateId The state ID. The prefix \"#\" is removed.\r\n */\n\n\n StateNode.prototype.getStateNodeById = function (stateId) {\n var resolvedStateId = isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;\n\n if (resolvedStateId === this.id) {\n return this;\n }\n\n var stateNode = this.machine.idMap[resolvedStateId];\n\n if (!stateNode) {\n throw new Error(\"Child state node '#\".concat(resolvedStateId, \"' does not exist on machine '\").concat(this.id, \"'\"));\n }\n\n return stateNode;\n };\n /**\r\n * Returns the relative state node from the given `statePath`, or throws.\r\n *\r\n * @param statePath The string or string array relative path to the state node.\r\n */\n\n\n StateNode.prototype.getStateNodeByPath = function (statePath) {\n if (typeof statePath === 'string' && isStateId(statePath)) {\n try {\n return this.getStateNodeById(statePath.slice(1));\n } catch (e) {// try individual paths\n // throw e;\n }\n }\n\n var arrayStatePath = toStatePath(statePath, this.delimiter).slice();\n var currentStateNode = this;\n\n while (arrayStatePath.length) {\n var key = arrayStatePath.shift();\n\n if (!key.length) {\n break;\n }\n\n currentStateNode = currentStateNode.getStateNode(key);\n }\n\n return currentStateNode;\n };\n /**\r\n * Resolves a partial state value with its full representation in this machine.\r\n *\r\n * @param stateValue The partial state value to resolve.\r\n */\n\n\n StateNode.prototype.resolve = function (stateValue) {\n var _a;\n\n var _this = this;\n\n if (!stateValue) {\n return this.initialStateValue || EMPTY_OBJECT; // TODO: type-specific properties\n }\n\n switch (this.type) {\n case 'parallel':\n return mapValues(this.initialStateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(stateValue[subStateKey] || subStateValue) : EMPTY_OBJECT;\n });\n\n case 'compound':\n if (isString(stateValue)) {\n var subStateNode = this.getStateNode(stateValue);\n\n if (subStateNode.type === 'parallel' || subStateNode.type === 'compound') {\n return _a = {}, _a[stateValue] = subStateNode.initialStateValue, _a;\n }\n\n return stateValue;\n }\n\n if (!Object.keys(stateValue).length) {\n return this.initialStateValue || {};\n }\n\n return mapValues(stateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(subStateValue) : EMPTY_OBJECT;\n });\n\n default:\n return stateValue || EMPTY_OBJECT;\n }\n };\n\n StateNode.prototype.getResolvedPath = function (stateIdentifier) {\n if (isStateId(stateIdentifier)) {\n var stateNode = this.machine.idMap[stateIdentifier.slice(STATE_IDENTIFIER.length)];\n\n if (!stateNode) {\n throw new Error(\"Unable to find state node '\".concat(stateIdentifier, \"'\"));\n }\n\n return stateNode.path;\n }\n\n return toStatePath(stateIdentifier, this.delimiter);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateValue\", {\n get: function () {\n var _a;\n\n if (this.__cache.initialStateValue) {\n return this.__cache.initialStateValue;\n }\n\n var initialStateValue;\n\n if (this.type === 'parallel') {\n initialStateValue = mapFilterValues(this.states, function (state) {\n return state.initialStateValue || EMPTY_OBJECT;\n }, function (stateNode) {\n return !(stateNode.type === 'history');\n });\n } else if (this.initial !== undefined) {\n if (!this.states[this.initial]) {\n throw new Error(\"Initial state '\".concat(this.initial, \"' not found on '\").concat(this.key, \"'\"));\n }\n\n initialStateValue = isLeafNode(this.states[this.initial]) ? this.initial : (_a = {}, _a[this.initial] = this.states[this.initial].initialStateValue, _a);\n } else {\n // The finite state value of a machine without child states is just an empty object\n initialStateValue = {};\n }\n\n this.__cache.initialStateValue = initialStateValue;\n return this.__cache.initialStateValue;\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getInitialState = function (stateValue, context) {\n this._init(); // TODO: this should be in the constructor (see note in constructor)\n\n\n var configuration = this.getStateNodes(stateValue);\n return this.resolveTransition({\n configuration: configuration,\n exitSet: [],\n transitions: [],\n source: undefined,\n actions: []\n }, undefined, context !== null && context !== void 0 ? context : this.machine.context, undefined);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialState\", {\n /**\r\n * The initial State instance, which includes all actions to be executed from\r\n * entering the initial state.\r\n */\n get: function () {\n var initialStateValue = this.initialStateValue;\n\n if (!initialStateValue) {\n throw new Error(\"Cannot retrieve initial state from simple state '\".concat(this.id, \"'.\"));\n }\n\n return this.getInitialState(initialStateValue);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"target\", {\n /**\r\n * The target state value of the history state node, if it exists. This represents the\r\n * default state value to transition to if no history value exists yet.\r\n */\n get: function () {\n var target;\n\n if (this.type === 'history') {\n var historyConfig = this.config;\n\n if (isString(historyConfig.target)) {\n target = isStateId(historyConfig.target) ? pathToStateValue(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;\n } else {\n target = historyConfig.target;\n }\n }\n\n return target;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Returns the leaf nodes from a state path relative to this state node.\r\n *\r\n * @param relativeStateId The relative state path to retrieve the state nodes\r\n * @param history The previous state to retrieve history\r\n * @param resolve Whether state nodes should resolve to initial child state nodes\r\n */\n\n StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {\n if (resolve === void 0) {\n resolve = true;\n }\n\n return resolve ? relativeStateId.type === 'history' ? relativeStateId.resolveHistory(historyValue) : relativeStateId.initialStateNodes : [relativeStateId];\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateNodes\", {\n get: function () {\n var _this = this;\n\n if (isLeafNode(this)) {\n return [this];\n } // Case when state node is compound but no initial state is defined\n\n\n if (this.type === 'compound' && !this.initial) {\n if (!IS_PRODUCTION) {\n warn(false, \"Compound state node '\".concat(this.id, \"' has no initial state.\"));\n }\n\n return [this];\n }\n\n var initialStateNodePaths = toStatePaths(this.initialStateValue);\n return flatten(initialStateNodePaths.map(function (initialPath) {\n return _this.getFromRelativePath(initialPath);\n }));\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Retrieves state nodes from a relative path to this state node.\r\n *\r\n * @param relativePath The relative path from this state node\r\n * @param historyValue\r\n */\n\n StateNode.prototype.getFromRelativePath = function (relativePath) {\n if (!relativePath.length) {\n return [this];\n }\n\n var _a = __read(relativePath),\n stateKey = _a[0],\n childStatePath = _a.slice(1);\n\n if (!this.states) {\n throw new Error(\"Cannot retrieve subPath '\".concat(stateKey, \"' from node with no states\"));\n }\n\n var childStateNode = this.getStateNode(stateKey);\n\n if (childStateNode.type === 'history') {\n return childStateNode.resolveHistory();\n }\n\n if (!this.states[stateKey]) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return this.states[stateKey].getFromRelativePath(childStatePath);\n };\n\n StateNode.prototype.historyValue = function (relativeStateValue) {\n if (!Object.keys(this.states).length) {\n return undefined;\n }\n\n return {\n current: relativeStateValue || this.initialStateValue,\n states: mapFilterValues(this.states, function (stateNode, key) {\n if (!relativeStateValue) {\n return stateNode.historyValue();\n }\n\n var subStateValue = isString(relativeStateValue) ? undefined : relativeStateValue[key];\n return stateNode.historyValue(subStateValue || stateNode.initialStateValue);\n }, function (stateNode) {\n return !stateNode.history;\n })\n };\n };\n /**\r\n * Resolves to the historical value(s) of the parent state node,\r\n * represented by state nodes.\r\n *\r\n * @param historyValue\r\n */\n\n\n StateNode.prototype.resolveHistory = function (historyValue) {\n var _this = this;\n\n if (this.type !== 'history') {\n return [this];\n }\n\n var parent = this.parent;\n\n if (!historyValue) {\n var historyTarget = this.target;\n return historyTarget ? flatten(toStatePaths(historyTarget).map(function (relativeChildPath) {\n return parent.getFromRelativePath(relativeChildPath);\n })) : parent.initialStateNodes;\n }\n\n var subHistoryValue = nestedPath(parent.path, 'states')(historyValue).current;\n\n if (isString(subHistoryValue)) {\n return [parent.getStateNode(subHistoryValue)];\n }\n\n return flatten(toStatePaths(subHistoryValue).map(function (subStatePath) {\n return _this.history === 'deep' ? parent.getFromRelativePath(subStatePath) : [parent.states[subStatePath[0]]];\n }));\n };\n\n Object.defineProperty(StateNode.prototype, \"stateIds\", {\n /**\r\n * All the state node IDs of this state node and its descendant state nodes.\r\n */\n get: function () {\n var _this = this;\n\n var childStateIds = flatten(Object.keys(this.states).map(function (stateKey) {\n return _this.states[stateKey].stateIds;\n }));\n return [this.id].concat(childStateIds);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"events\", {\n /**\r\n * All the event types accepted by this state node and its descendants.\r\n */\n get: function () {\n var e_8, _a, e_9, _b;\n\n if (this.__cache.events) {\n return this.__cache.events;\n }\n\n var states = this.states;\n var events = new Set(this.ownEvents);\n\n if (states) {\n try {\n for (var _c = __values(Object.keys(states)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var stateId = _d.value;\n var state = states[stateId];\n\n if (state.states) {\n try {\n for (var _e = (e_9 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {\n var event_1 = _f.value;\n events.add(\"\".concat(event_1));\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n }\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n }\n\n return this.__cache.events = Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"ownEvents\", {\n /**\r\n * All the events that have transitions directly from this state node.\r\n *\r\n * Excludes any inert events.\r\n */\n get: function () {\n var events = new Set(this.transitions.filter(function (transition) {\n return !(!transition.target && !transition.actions.length && transition.internal);\n }).map(function (transition) {\n return transition.eventType;\n }));\n return Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.resolveTarget = function (_target) {\n var _this = this;\n\n if (_target === undefined) {\n // an undefined target signals that the state node should not transition from that state when receiving that event\n return undefined;\n }\n\n return _target.map(function (target) {\n if (!isString(target)) {\n return target;\n }\n\n var isInternalTarget = target[0] === _this.delimiter; // If internal target is defined on machine,\n // do not include machine key on target\n\n if (isInternalTarget && !_this.parent) {\n return _this.getStateNodeByPath(target.slice(1));\n }\n\n var resolvedTarget = isInternalTarget ? _this.key + target : target;\n\n if (_this.parent) {\n try {\n var targetStateNode = _this.parent.getStateNodeByPath(resolvedTarget);\n\n return targetStateNode;\n } catch (err) {\n throw new Error(\"Invalid transition definition for state node '\".concat(_this.id, \"':\\n\").concat(err.message));\n }\n } else {\n return _this.getStateNodeByPath(resolvedTarget);\n }\n });\n };\n\n StateNode.prototype.formatTransition = function (transitionConfig) {\n var _this = this;\n\n var normalizedTarget = normalizeTarget(transitionConfig.target);\n var internal = 'internal' in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function (_target) {\n return isString(_target) && _target[0] === _this.delimiter;\n }) : true;\n var guards = this.machine.options.guards;\n var target = this.resolveTarget(normalizedTarget);\n\n var transition = __assign(__assign({}, transitionConfig), {\n actions: toActionObjects(toArray(transitionConfig.actions)),\n cond: toGuard(transitionConfig.cond, guards),\n target: target,\n source: this,\n internal: internal,\n eventType: transitionConfig.event,\n toJSON: function () {\n return __assign(__assign({}, transition), {\n target: transition.target ? transition.target.map(function (t) {\n return \"#\".concat(t.id);\n }) : undefined,\n source: \"#\".concat(_this.id)\n });\n }\n });\n\n return transition;\n };\n\n StateNode.prototype.formatTransitions = function () {\n var e_10, _a;\n\n var _this = this;\n\n var onConfig;\n\n if (!this.config.on) {\n onConfig = [];\n } else if (Array.isArray(this.config.on)) {\n onConfig = this.config.on;\n } else {\n var _b = this.config.on,\n _c = WILDCARD,\n _d = _b[_c],\n wildcardConfigs = _d === void 0 ? [] : _d,\n strictTransitionConfigs_1 = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\"]);\n\n onConfig = flatten(Object.keys(strictTransitionConfigs_1).map(function (key) {\n if (!IS_PRODUCTION && key === NULL_EVENT) {\n warn(false, \"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. \" + \"Please check the `on` configuration for \\\"#\".concat(_this.id, \"\\\".\"));\n }\n\n var transitionConfigArray = toTransitionConfigArray(key, strictTransitionConfigs_1[key]);\n\n if (!IS_PRODUCTION) {\n validateArrayifiedTransitions(_this, key, transitionConfigArray);\n }\n\n return transitionConfigArray;\n }).concat(toTransitionConfigArray(WILDCARD, wildcardConfigs)));\n }\n\n var eventlessConfig = this.config.always ? toTransitionConfigArray('', this.config.always) : [];\n var doneConfig = this.config.onDone ? toTransitionConfigArray(String(done(this.id)), this.config.onDone) : [];\n\n if (!IS_PRODUCTION) {\n warn(!(this.config.onDone && !this.parent), \"Root nodes cannot have an \\\".onDone\\\" transition. Please check the config of \\\"\".concat(this.id, \"\\\".\"));\n }\n\n var invokeConfig = flatten(this.invoke.map(function (invokeDef) {\n var settleTransitions = [];\n\n if (invokeDef.onDone) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(doneInvoke(invokeDef.id)), invokeDef.onDone)), false));\n }\n\n if (invokeDef.onError) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(error(invokeDef.id)), invokeDef.onError)), false));\n }\n\n return settleTransitions;\n }));\n var delayedTransitions = this.after;\n var formattedTransitions = flatten(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(doneConfig), false), __read(invokeConfig), false), __read(onConfig), false), __read(eventlessConfig), false).map(function (transitionConfig) {\n return toArray(transitionConfig).map(function (transition) {\n return _this.formatTransition(transition);\n });\n }));\n\n try {\n for (var delayedTransitions_1 = __values(delayedTransitions), delayedTransitions_1_1 = delayedTransitions_1.next(); !delayedTransitions_1_1.done; delayedTransitions_1_1 = delayedTransitions_1.next()) {\n var delayedTransition = delayedTransitions_1_1.value;\n formattedTransitions.push(delayedTransition);\n }\n } catch (e_10_1) {\n e_10 = {\n error: e_10_1\n };\n } finally {\n try {\n if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a = delayedTransitions_1.return)) _a.call(delayedTransitions_1);\n } finally {\n if (e_10) throw e_10.error;\n }\n }\n\n return formattedTransitions;\n };\n\n return StateNode;\n}();\n\nexport { StateNode };\n","import { StateNode } from './StateNode.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar warned = false;\nfunction Machine(config, options, initialContext) {\n if (initialContext === void 0) {\n initialContext = config.context;\n }\n\n return new StateNode(config, options, initialContext);\n}\nfunction createMachine(config, options) {\n if (!IS_PRODUCTION && !('predictableActionArguments' in config) && !warned) {\n warned = true;\n console.warn('It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html');\n }\n\n return new StateNode(config, options);\n}\n\nexport { Machine, createMachine };\n","import { __values } from './_virtual/_tslib.js';\nimport { matchesState } from './utils.js';\n\nfunction mapState(stateMap, stateId) {\n var e_1, _a;\n\n var foundStateId;\n\n try {\n for (var _b = __values(Object.keys(stateMap)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var mappedStateId = _c.value;\n\n if (matchesState(mappedStateId, stateId) && (!foundStateId || stateId.length > foundStateId.length)) {\n foundStateId = mappedStateId;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return stateMap[foundStateId];\n}\n\nexport { mapState };\n","import { __values, __read } from './_virtual/_tslib.js';\nimport { State } from './State.js';\n\nfunction matchState(state, patterns, defaultValue) {\n var e_1, _a;\n\n var resolvedState = State.from(state, state instanceof State ? state.context : undefined);\n\n try {\n for (var patterns_1 = __values(patterns), patterns_1_1 = patterns_1.next(); !patterns_1_1.done; patterns_1_1 = patterns_1.next()) {\n var _b = __read(patterns_1_1.value, 2),\n stateValue = _b[0],\n getValue = _b[1];\n\n if (resolvedState.matches(stateValue)) {\n return getValue(resolvedState);\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (patterns_1_1 && !patterns_1_1.done && (_a = patterns_1.return)) _a.call(patterns_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return defaultValue(resolvedState);\n}\n\nexport { matchState };\n","function createSchema(schema) {\n return schema;\n}\nvar t = createSchema;\n\nexport { createSchema, t };\n","import { assign as assign$1, send as send$1, sendTo as sendTo$1, sendParent as sendParent$1, sendUpdate as sendUpdate$1, forwardTo as forwardTo$1, doneInvoke as doneInvoke$1, raise as raise$1, log as log$1, pure as pure$1, choose as choose$1, stop as stop$1 } from './actions.js';\nimport * as actions from './actions.js';\nexport { actions };\nexport { toActorRef } from './Actor.js';\nexport { Interpreter, InterpreterStatus, interpret, spawn } from './interpreter.js';\nexport { Machine, createMachine } from './Machine.js';\nexport { mapState } from './mapState.js';\nexport { matchState } from './match.js';\nexport { createSchema, t } from './schema.js';\nexport { State } from './State.js';\nexport { StateNode } from './StateNode.js';\nexport { spawnBehavior } from './behaviors.js';\nexport { ActionTypes, SpecialTargets } from './types.js';\nexport { matchesState, toEventObject, toObserver, toSCXMLEvent } from './utils.js';\n\nvar assign = assign$1,\n send = send$1,\n sendTo = sendTo$1,\n sendParent = sendParent$1,\n sendUpdate = sendUpdate$1,\n forwardTo = forwardTo$1,\n doneInvoke = doneInvoke$1,\n raise = raise$1,\n log = log$1,\n pure = pure$1,\n choose = choose$1,\n stop = stop$1;\n\nexport { assign, choose, doneInvoke, forwardTo, log, pure, raise, send, sendParent, sendTo, sendUpdate, stop };\n","import { useLayoutEffect } from 'react';\n\nvar index = useLayoutEffect ;\n\nexport default index;\n","import * as React from 'react';\nexport default function useConstant(fn) {\n var ref = React.useRef();\n if (!ref.current) {\n ref.current = { v: fn() };\n }\n return ref.current.v;\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { useEffect, useState } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport { interpret, InterpreterStatus, State, toObserver } from 'xstate';\nimport useConstant from './useConstant';\nexport function useIdleInterpreter(getMachine, options) {\n var machine = useConstant(function () {\n return typeof getMachine === 'function' ? getMachine() : getMachine;\n });\n if (process.env.NODE_ENV !== 'production' &&\n typeof getMachine !== 'function') {\n var _a = __read(useState(machine), 1), initialMachine = _a[0];\n if (getMachine !== initialMachine) {\n console.warn('Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\\n' +\n 'Please make sure that you pass the same Machine as argument each time.');\n }\n }\n var context = options.context, guards = options.guards, actions = options.actions, activities = options.activities, services = options.services, delays = options.delays, rehydratedState = options.state, interpreterOptions = __rest(options, [\"context\", \"guards\", \"actions\", \"activities\", \"services\", \"delays\", \"state\"]);\n var service = useConstant(function () {\n var machineConfig = {\n context: context,\n guards: guards,\n actions: actions,\n activities: activities,\n services: services,\n delays: delays\n };\n var machineWithConfig = machine.withConfig(machineConfig, function () { return (__assign(__assign({}, machine.context), context)); });\n return interpret(machineWithConfig, interpreterOptions);\n });\n // Make sure options are kept updated when they change.\n // This mutation assignment is safe because the service instance is only used\n // in one place -- this hook's caller.\n useIsomorphicLayoutEffect(function () {\n Object.assign(service.machine.options.actions, actions);\n Object.assign(service.machine.options.guards, guards);\n Object.assign(service.machine.options.activities, activities);\n Object.assign(service.machine.options.services, services);\n Object.assign(service.machine.options.delays, delays);\n }, [actions, guards, activities, services, delays]);\n return service;\n}\nexport function useInterpret(getMachine) {\n var _a = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n _a[_i - 1] = arguments[_i];\n }\n var _b = __read(_a, 2), _c = _b[0], options = _c === void 0 ? {} : _c, observerOrListener = _b[1];\n var service = useIdleInterpreter(getMachine, options);\n useEffect(function () {\n if (!observerOrListener) {\n return;\n }\n var sub = service.subscribe(toObserver(observerOrListener));\n return function () {\n sub.unsubscribe();\n };\n }, [observerOrListener]);\n useEffect(function () {\n var rehydratedState = options.state;\n service.start(rehydratedState ? State.create(rehydratedState) : undefined);\n return function () {\n service.stop();\n service.status = InterpreterStatus.NotStarted;\n };\n }, []);\n return service;\n}\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nimport { InterpreterStatus } from 'xstate';\nexport function partition(items, predicate) {\n var e_1, _a;\n var _b = __read([[], []], 2), truthy = _b[0], falsy = _b[1];\n try {\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item = items_1_1.value;\n if (predicate(item)) {\n truthy.push(item);\n }\n else {\n falsy.push(item);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return [truthy, falsy];\n}\nexport function getServiceSnapshot(service) {\n return service.status !== 0\n ? service.getSnapshot()\n : service.machine.initialState;\n}\n// From https://github.com/reduxjs/react-redux/blob/master/src/utils/shallowEqual.ts\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n }\n else {\n return x !== x && y !== y;\n }\n}\nexport function shallowEqual(objA, objB) {\n if (is(objA, objB))\n return true;\n if (typeof objA !== 'object' ||\n objA === null ||\n typeof objB !== 'object' ||\n objB === null) {\n return false;\n }\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length)\n return false;\n for (var i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) ||\n !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\nexport function isService(actor) {\n return 'state' in actor && 'machine' in actor;\n}\nexport function isInterpreterStateEqual(service, prevState, nextState) {\n if (service.status === InterpreterStatus.NotStarted) {\n return true;\n }\n // Only change the current state if:\n // - the incoming state is the \"live\" initial state (since it might have new actors)\n // - OR the incoming state actually changed.\n //\n // The \"live\" initial state will have .changed === undefined.\n var initialStateChanged = nextState.changed === undefined &&\n (Object.keys(nextState.children).length > 0 ||\n typeof prevState.changed === 'boolean');\n return !(nextState.changed || initialStateChanged);\n}\n","import { useRef, useCallback } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport useConstant from './useConstant';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { getServiceSnapshot, isInterpreterStateEqual, isService } from './utils';\nfunction identity(a) {\n return a;\n}\nexport function isActorWithState(actorRef) {\n return 'state' in actorRef;\n}\nfunction isDeferredActor(actorRef) {\n return 'deferred' in actorRef;\n}\nfunction defaultGetSnapshot(actorRef) {\n return 'getSnapshot' in actorRef\n ? isService(actorRef)\n ? getServiceSnapshot(actorRef)\n : actorRef.getSnapshot()\n : isActorWithState(actorRef)\n ? actorRef.state\n : undefined;\n}\nexport function useActor(actorRef, getSnapshot) {\n if (getSnapshot === void 0) { getSnapshot = defaultGetSnapshot; }\n var actorRefRef = useRef(actorRef);\n var deferredEventsRef = useRef([]);\n var subscribe = useCallback(function (handleStoreChange) {\n var unsubscribe = actorRef.subscribe(handleStoreChange).unsubscribe;\n return unsubscribe;\n }, [actorRef]);\n var boundGetSnapshot = useCallback(function () { return getSnapshot(actorRef); }, [actorRef, getSnapshot]);\n var isEqual = useCallback(function (prevState, nextState) {\n if (isService(actorRef)) {\n return isInterpreterStateEqual(actorRef, prevState, nextState);\n }\n return prevState === nextState;\n }, [actorRef]);\n var storeSnapshot = useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, identity, isEqual);\n var send = useConstant(function () { return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var event = args[0];\n if (process.env.NODE_ENV !== 'production' && args.length > 1) {\n console.warn(\"Unexpected payload: \".concat(JSON.stringify(args[1]), \". Only a single event object can be sent to actor send() functions.\"));\n }\n var currentActorRef = actorRefRef.current;\n // If the previous actor is a deferred actor,\n // queue the events so that they can be replayed\n // on the non-deferred actor.\n if (isDeferredActor(currentActorRef) && currentActorRef.deferred) {\n deferredEventsRef.current.push(event);\n }\n else {\n currentActorRef.send(event);\n }\n }; });\n useIsomorphicLayoutEffect(function () {\n actorRefRef.current = actorRef;\n // Dequeue deferred events from the previous deferred actorRef\n while (deferredEventsRef.current.length > 0) {\n var deferredEvent = deferredEventsRef.current.shift();\n actorRef.send(deferredEvent);\n }\n }, [actorRef]);\n return [storeSnapshot, send];\n}\n","import { useCallback, useRef } from 'react';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isActorWithState } from './useActor';\nimport { getServiceSnapshot, isService } from './utils';\nvar defaultCompare = function (a, b) { return a === b; };\nvar defaultGetSnapshot = function (a, initialStateCacheRef) {\n if (isService(a)) {\n // A status of 0 = interpreter not started\n if (a.status === 0 && initialStateCacheRef.current) {\n return initialStateCacheRef.current;\n }\n var snapshot = getServiceSnapshot(a);\n initialStateCacheRef.current = a.status === 0 ? snapshot : null;\n return snapshot;\n }\n return isActorWithState(a) ? a.state : undefined;\n};\nexport function useSelector(actor, selector, compare, getSnapshot) {\n if (compare === void 0) { compare = defaultCompare; }\n var initialStateCacheRef = useRef(null);\n var subscribe = useCallback(function (handleStoreChange) {\n var unsubscribe = actor.subscribe(handleStoreChange).unsubscribe;\n return unsubscribe;\n }, [actor]);\n var boundGetSnapshot = useCallback(function () {\n if (getSnapshot) {\n return getSnapshot(actor);\n }\n return defaultGetSnapshot(actor, initialStateCacheRef);\n }, [actor, getSnapshot]);\n var selectedSnapshot = useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);\n return selectedSnapshot;\n}\n","import { StateFrom, assign, createMachine, send } from 'xstate'\nimport {\n AdsByAdManagerAccountIdsDocument,\n AdsByAdManagerAccountIdsQuery,\n AdsetsAdsByAdManagerAccountIdsDocument,\n AdsetsAdsByAdManagerAccountIdsQuery,\n AdsetsByAdManagerAccountIdsDocument,\n AdsetsByAdManagerAccountIdsQuery,\n FoxTraxAttribution,\n FacebookAttribution,\n CampaignsAdsetsAdsByAdManagerAccountIdsDocument,\n CampaignsAdsetsAdsByAdManagerAccountIdsQuery,\n CampaignsByAdManagerAccountIdsDocument,\n CampaignsByAdManagerAccountIdsQuery,\n SortInput,\n} from '../../__generated__/graphql'\nimport { client as apolloClient } from '../../graphql/client'\nimport { ApolloQueryResult } from '@apollo/client'\nimport { message } from 'antd'\nimport { SearchTerms } from '../../components/SearchBar/SearchBar'\n\nfunction getValuesByKey(tags: SearchTerms[], key: string): string[] {\n return tags\n .filter(tag => tag?.key.startsWith(`${key.toUpperCase()}-`))\n .map(tag => tag.value)\n}\nexport interface DateRange {\n start: string | null\n end: string | null\n}\n\nexport enum AttributionTableTabs {\n CAMPAIGNS = 'CAMPAIGNS',\n ADSETS = 'ADSETS',\n ADS = 'ADS',\n}\n\ninterface OnDoneGetAdsetsDataEvent {\n type: 'done.invoke.getAdsetsDataService'\n data: AdsetsByAdManagerAccountIdsQuery\n}\n\ninterface OnDoneGetCampaignsDataEvent {\n type: 'done.invoke.getCampaignsDataService'\n data: CampaignsByAdManagerAccountIdsQuery\n}\n\ninterface OnDoneGetAdsDataEvent {\n type: 'done.invoke.getAdsDataService'\n data: AdsByAdManagerAccountIdsQuery\n}\n\ninterface OnDoneGetCampaignsAdsetsAdsDataEvent {\n type: 'done.invoke.getCampaignsAdsetsAdsDataService'\n data: CampaignsAdsetsAdsByAdManagerAccountIdsQuery\n}\n\ninterface OnDoneGetAdsetsAdsDataEvent {\n type: 'done.invoke.getAdsetsAdsDataService'\n data: AdsetsAdsByAdManagerAccountIdsQuery\n}\n\nexport type RowKey = string | number\n\nexport type DashboardMachineData = {\n campaignsQuery: CampaignsByAdManagerAccountIdsQuery['campaignsByAdManagerAccountIds'] | CampaignsAdsetsAdsByAdManagerAccountIdsQuery['campaignsByAdManagerAccountIds']\n adsetsQuery:\n | AdsetsByAdManagerAccountIdsQuery['adsetsByAdManagerAccountIds']\n | CampaignsAdsetsAdsByAdManagerAccountIdsQuery['adsetsByAdManagerAccountIds']\n | AdsetsAdsByAdManagerAccountIdsQuery['adsetsByAdManagerAccountIds']\n adsQuery:\n | AdsByAdManagerAccountIdsQuery['adsByAdManagerAccountIds']\n | CampaignsAdsetsAdsByAdManagerAccountIdsQuery['adsByAdManagerAccountIds']\n | AdsetsAdsByAdManagerAccountIdsQuery['adsByAdManagerAccountIds']\n}\n\ninterface DashboardContext {\n data: DashboardMachineData\n\n selectedCampaigns: RowKey[]\n selectedAdsets: RowKey[]\n selectedAds: RowKey[]\n\n attributionSetting: {\n foxtraxAttribution?: FoxTraxAttribution\n facebookAttribution?: FacebookAttribution\n }\n\n tab: AttributionTableTabs\n limit: number\n offset: {\n campaigns: number\n adsets: number\n ads: number\n }\n dateRange: DateRange\n adAccounts: string[]\n search: SearchTerms[]\n refresh: boolean | false\n\n // V2\n filters: {\n campaigns: unknown\n adsets: unknown\n ads: unknown\n }\n sort: {\n campaigns: SortInput[]\n adsets: SortInput[]\n ads: SortInput[]\n }\n columns: {\n campaigns: string[]\n adsets: string[]\n ads: string[]\n }\n}\n\n\n\nconst dashboardContext: DashboardContext = {\n data: {\n campaignsQuery: {\n campaigns: [],\n total: 0,\n aggregates: {},\n totals: {\n spend: 0,\n dailyBudget: 0,\n orders: {\n total: 0,\n attributed: 0,\n facebook: 0,\n organic: 0,\n },\n revenue: {\n total: 0,\n attributed: 0,\n facebook: 0,\n organic: 0,\n },\n },\n },\n adsetsQuery: {\n adsets: [],\n total: 0,\n aggregates: {},\n totals: {\n spend: 0,\n dailyBudget: 0,\n orders: {\n total: 0,\n attributed: 0,\n facebook: 0,\n organic: 0,\n },\n revenue: {\n total: 0,\n attributed: 0,\n facebook: 0,\n organic: 0,\n },\n },\n },\n adsQuery: {\n ads: [],\n total: 0,\n aggregates: {},\n totals: {\n spend: 0, \n dailyBudget: 0,\n orders: {\n total: 0,\n attributed: 0,\n facebook: 0,\n organic: 0,\n },\n revenue: {\n total: 0,\n attributed: 0,\n facebook: 0,\n organic: 0,\n },\n },\n },\n },\n attributionSetting: {\n foxtraxAttribution: FoxTraxAttribution.SevenDayLastClick,\n facebookAttribution: FacebookAttribution.SevenDayClickOrOneDayView,\n },\n selectedCampaigns: [],\n selectedAdsets: [],\n selectedAds: [],\n tab: AttributionTableTabs.CAMPAIGNS,\n limit: 10,\n offset: {\n campaigns: 1,\n adsets: 1,\n ads: 1,\n },\n adAccounts: [],\n dateRange: {\n start: null,\n end: null,\n },\n search: [],\n filters: {\n campaigns: {},\n adsets: {},\n ads: {},\n },\n sort: {\n campaigns: [],\n adsets: [],\n ads: [],\n },\n columns: {\n campaigns: [],\n adsets: [],\n ads: [],\n },\n refresh: false,\n}\n\nexport type DashboardMachineState = StateFrom\n\nexport const dashboardMachine = (persistedDashboardContext: DashboardContext | null = null) =>\n createMachine(\n {\n /** @xstate-layout N4IgpgJg5mDOIC5QQIawBYCMD2KBOEAsigMboCWAdmAMQBKAogMoMAqA+qwPLsAiDAMQCCAVQAyHBgDUGAOVYBtAAwBdRKAAO2WOQAu5bJXUgAHogC0AZksB2AHRKAHADZHtxwE4PjgExKPADQgAJ4WSnaWjkpOACw+Nko+AIzOfi4AvulBqBg4+ESkFNQ0AMJChAAKQgCSAOKy7CVi1SUA0uzScoqqxlo6+obGZgg+njEOzt7eNs5JCSlBoQgArIl2ox4xvpYxMZauHpaZ2WhYuATEZFS0QrwsHE0t7Z3yympIIH16BkYfw5ajSx2GY+LarDxKZZJOaLRCrHzrTzLGJeJQ2FzLZzLY4gHJnfKXIq0e7sFhiBglVgMXiNcpVOqyJgdGSvHofL4DX6gYYzOxJLa7LE2DzLSILEKIGJYiJC0FI5LOHF4vIXQrXGgkskUqk0273JkvbrvTTab6DP6IGw2WEIRx29ZJFyHWaWJQxZbYrK404qgpXYqahjkynU9h65ldN69U2coaIJLxZYOYW+Dw+Zx7BOOG3mBL2eIpVz7JxJZY2JU+85+omlclCOikoPa0Phw1R9kxn5xhBp5zAyzQybLRyl3w+HN59Y2FI7MsQ5w2T0nXJVwnqpoMeuN4M6sN3NgGllG6P9LsWntJPkCyJu3Zo7w2pJKUt8-YeJIQ0sJD0VlcEtXFBuW5aiGNJlJUNT1IekZsiap7mtyloeBEbqTD4yQxOiMRujaLoOIcoruL4yzob++Kqv6xJsJwQgAEIRqyxqfJ2CGmIgzhKECcTeKKpaiiizgTmiU4zu6wpKAuS7en+FE1iSzSENUkhHu2cFmlybEILy-KOIKc6iiOgkSggo5AqsNhbM4libB46Lll6yqrgBVEPHSkGMjRtHkuwXACAIJJtrBzHwRpPLWsZPgAuMUIAhZTieLpZG+muAbUXqB6ed5vn+dRgVMRyZ6IVp4VLD4772FhLgoh+iQZklTmURqaV3JlDA+X5AUqUFBWsWFj78uMtlWqCoIZo69X-o1JK3GGJQlFwIjyNBjEnup3baQKUr6WKRlLHMWx2C4nHDoZVn+BNsnqiSvBCFS7B0EIsi1G1eWrbG55WjafgonyHgZouST7JYqxHA5laTXJaWsKwdDVLRIisNUXANPciNPctx4diF619jpenCgZ4pLAO9hPrpJ3oVstkXdWV3USw9YlAAEgxmNqe9RUbbpW0Eztj7WHYkyRHsHrJE6NMpS592CIwTAs69WNreeLh8o4i6cY4UJoiCX0fshqSpGVI0xONYMybTqWuRBDJMqwdHeQI1QSAwdAY6pwVK5zJWIKCNgIn4w7xMkGs2KDy7kRbUvpawtv221jvO67rPuz1oWWt7CCurMDils4GbB-E9nh8lzlNRw4Z2158dO1SScK+zhWaZ9xkJu+dhllEoyYoO7oS6XJLgfSUGtaSXB0MpMH5SxafFV9szIYuUR2m4uwAmH0kR5LZd7vqI9MGPE8rYrHNNxn1genYaZzJsmKrNCfdTc1sdV6P4-J910-rRnA3hKKouOh3bCHgH6QytkPDyldvLzTECIQgHl64exPjyPsVlRj+FGAuac1kvozCTO4CSC4sSxBAXTcu+4Y4j2gbA+BXUp7Yw+mfNIdgpSaylCiY6JDLY70oVwGBcC3Yf3oV7G0FlLyQldBsSYi4UScLAHYGAuheAoF0CgJgKjdByIUUICAsAwC6FgEolRajlG0AgIYORVAABu2AADWmi9HaN0fowxqiwB4EseQEgYAU6f3PE+CEDhogST+n4UEf056QkOnsK0kRC5JFkfIvRLjjEaMSboRxeiDHKNUeo2gbi8DYDwHYDQAAbZRAAzQpABbNJGTnHZKYG4jxXifFCM0v48IQTgmpESAJOeXh1h-WnOiHYLCEkKOSbk2pOjJkmJoGY6gdgrG2PsekmZDSmmeO8YIz27T-CdKCZMHpYTdrxgJhEBM1g5h5lXuMpJDSplaPWUY3JNB8mFOKWU3QlS8A1KeVkoxmyWk7KQfGfZgTohHNCX0luHEkzYWWCKdMLhrK+DuYoh5Ji0klBQFUjQKByBQEoACnJcyFkWMoNYux2LcX4sJcS5JQLtl0N2cMDpELunQvCRFAECJNrmX2HCxUZtN7OTSbM1JCicV4oJUSklKS8l4AKUU0pFTqk0plfS+VTLWmsrBQErpULenctKibJMhxQ6bAstYKyRcN4l0ouKzFkq9HSrpXKupsBHEStMeYpZlKVkavdcSz13qNnuK2bq0FJlwWGpCca05JkeIOjVmTD0+zhXFwakSJ1LysVStpbKkNOjMlhrzRot5SqPmqu+eqgtmqPUlv0WW1xEbgUsujeyuNxyYWlUBgiDuaIUgkR8IiqSjkIbXFzaSl1aynFeueTO31izlnUv+aWxdjS23Mreo3NlsbDnxpOY+AUl8vALjcCRec6KfXTPnS2hVlblWfLVb8u9G7tXbqjXu-VBzIVHt7fGMqSZ-CCtWFZfki4b3OrkWQMAJAbF0DgJkx9ssn4ZXDNlTqk9d29SAz9VYmEFw7AkskfmulL5YjKqkO+swYjQfLbB9A8HEPIf0ah5gT92o5UPmzRBP6TKjvGH7PO1l0LCkwtmWF3hDqIv5JCTEGFx3g0uosiZMG7BwYQ0h+dHGB5uRtjvDDLUsO5VobhmeXbD09pNfGZewIsRQj+gijijgGNLs08x7TbHYB6eooPdyTJTO8e-XhkyH4kzTjtFCaEbhbJfXQn2TiCYx3oTRGWdzCrPMsZ0yh15aGyG72C+-DtAmEyjsvtzKEexZgei+uCCIEJA4ulNlmydan7mMey953Trz5ryGqLIEQbVuDsGqLwbyCDU7dgi-rOYZULKjQkt-MYh1hSJl0nMc+mQvSUGwBAOAxgJ2qbABZ7sowrzcyFCKPmxkpS-VsOiFwkVXQkWU+bSW06FVnfPH-DlT50QikhP1Ky+FgbvlBB6YimXHkOKbfK3JP2iqpHGPyUYasFzumBkkerKRDoLkdP4Ms-EYf5rhwjkxSPNLz0FrpNMQTbDpnHLCx0gsATIl2IcSK8SRUOpzeprr9bg0U40VT4YqRLzPcXM6ZeXgEsC3MprdEeduJ2uO5HL7sPdBuqLQu+9m7EfHwE8OIEXSAdImBy3Twl59jThSyiRc73RWOoFx58gEASlgG+0bsLlMkwpcBsiCy75DiPivsw1I1vrIWStKT2doaDeU59zPHpwJnzDifGVJrMR+acXbgkPwaIhbCmAbz7NU7XdZa06x3rSeG5hdzkCWYftdJYk8Ozx80WIgemGh6QGhxQaZCAA */\n tsTypes: {} as import('./dashboardMachine.typegen').Typegen0,\n\n schema: {\n context: {} as DashboardContext,\n events: {} as\n | {\n type: 'SET_ATTRIBUTION_SETTINGS_EVENT'\n attributionSetting: {\n foxtraxAttribution?: FoxTraxAttribution\n facebookAttribution?: FacebookAttribution\n }\n }\n | {\n type: 'RESET_TO_DEFAULT_EVENT'\n }\n | {\n type: 'CAMPAIGN_CLICK_EVENT'\n selectedCampaigns: RowKey[]\n tab: AttributionTableTabs\n }\n | {\n type: 'ADSET_CLICK_EVENT'\n selectedAdsets: RowKey[]\n tab: AttributionTableTabs\n }\n | {\n type: 'SET_SELECTED_CAMPAIGNS_EVENT'\n selectedCampaigns: RowKey[]\n }\n | {\n type: 'SET_SELECTED_ADSETS_EVENT'\n selectedAdsets: RowKey[]\n }\n | {\n type: 'SET_SELECTED_ADS_EVENT'\n selectedAds: RowKey[]\n }\n | {\n type: 'CLEAR_SELECTED_CAMPAIGNS_EVENT'\n }\n | {\n type: 'CLEAR_SELECTED_ADSETS_EVENT'\n }\n | {\n type: 'CLEAR_SELECTED_ADS_EVENT'\n }\n | {\n type: 'SET_TAB_EVENT'\n tab: AttributionTableTabs\n }\n | {\n type: 'SET_LIMIT_EVENT'\n limit: number\n }\n | {\n type: 'SET_CAMPAIGNS_TABLE_OFFSET_EVENT'\n offset: number\n }\n | {\n type: 'SET_ADSETS_TABLE_OFFSET_EVENT'\n offset: number\n }\n | {\n type: 'SET_ADS_TABLE_OFFSET_EVENT'\n offset: number\n }\n | {\n type: 'SET_AD_ACCOUNTS_EVENT'\n adAccounts: string[]\n }\n | {\n type: 'SET_DATE_RANGE_EVENT'\n dateRange: DateRange\n }\n | {\n type: 'SET_SEARCH_EVENT'\n search: SearchTerms[]\n }\n | {\n type: 'SET_CAMPAIGNS_TABLE_FILTERS_EVENT'\n filters: unknown\n }\n | {\n type: 'SET_ADSETS_TABLE_FILTERS_EVENT'\n filters: unknown\n }\n | {\n type: 'SET_ADS_TABLE_FILTERS_EVENT'\n filters: unknown\n }\n | {\n type: 'SET_CAMPAIGNS_TABLE_SORT_EVENT'\n sort: SortInput[]\n }\n | {\n type: 'SET_ADSETS_TABLE_SORT_EVENT'\n sort: SortInput[]\n }\n | {\n type: 'SET_ADS_TABLE_SORT_EVENT'\n sort: SortInput[]\n }\n | {\n type: 'SET_CAMPAIGNS_TABLE_COLUMNS_EVENT'\n columns: string[]\n }\n | {\n type: 'SET_ADSETS_TABLE_COLUMNS_EVENT'\n columns: string[]\n }\n | {\n type: 'SET_ADS_TABLE_COLUMNS_EVENT'\n columns: string[]\n }\n | {\n type: 'SET_REFRESH_EVENT'\n refresh: boolean\n }\n | {\n type: 'RESET_ADSETS_ADS_OFFSET_EVENT'\n }\n | {\n type: 'RESET_ADS_OFFSET_EVENT'\n }\n | {\n type: 'RESET_CAMPAIGNS_ADSETS_ADS_OFFSET_EVENT'\n }\n | {\n type: 'RESET_CAMPAIGNS_OFFSET_EVENT'\n }\n | {\n type: 'RESET_ADSETS_OFFSET_EVENT'\n }\n | {\n type: 'CONTINUE_TO_IDLE_EVENT'\n }\n | OnDoneGetAdsetsDataEvent\n | OnDoneGetCampaignsDataEvent\n | OnDoneGetAdsDataEvent\n | OnDoneGetCampaignsAdsetsAdsDataEvent\n | OnDoneGetAdsetsAdsDataEvent,\n },\n\n id: 'dashboardMachine',\n context: persistedDashboardContext ?? dashboardContext,\n\n states: {\n getDataState: {\n description: `State that can get data for the applications dashboard.`,\n\n states: {\n getAdsetsDataState: {\n invoke: {\n src: 'getAdsetsDataService',\n\n onDone: {\n target: 'checkResetsState',\n actions: 'saveAdsetsDataAction',\n },\n\n onError: {\n target: 'idleState',\n actions: 'getDataMessageErrorAction',\n },\n id: 'getAdsetsDataService',\n },\n\n description: `State that invokes a promise to query for Adsets data.`,\n },\n\n getAdsDataState: {\n invoke: {\n src: 'getAdsDataService',\n\n onDone: {\n target: 'checkResetsState',\n actions: 'saveAdsDataAction',\n },\n\n onError: {\n target: 'idleState',\n actions: 'getDataMessageErrorAction',\n },\n id: 'getAdsDataService',\n },\n\n description: `State that invokes a promise to query for Ads data.`,\n },\n\n getCampaignsDataState: {\n invoke: {\n src: 'getCampaignsDataService',\n\n onDone: {\n target: 'checkResetsState',\n actions: 'saveCampaignsDataAction',\n },\n\n onError: {\n target: 'idleState',\n actions: 'getDataMessageErrorAction',\n },\n id: 'getCampaignsDataService',\n },\n\n description: `State that invokes a promise to query for Campaigns data.`,\n },\n\n getCampaignsAdsetsAdsDataState: {\n invoke: {\n src: 'getCampaignsAdsetsAdsDataService',\n id: 'getCampaignsAdsetsAdsDataService',\n onDone: {\n target: 'checkResetsState',\n actions: ['saveCampaignsDataAction', 'saveAdsetsDataAction', 'saveAdsDataAction'],\n },\n onError: {\n target: 'idleState',\n actions: 'getDataMessageErrorAction',\n },\n },\n\n description: `State that invokes a promise to query for Campaigns, Adsets, and Ads data.`,\n },\n\n idleState: {},\n\n getAdsetsAdsDataState: {\n description: `State that invokes a promise to query for Adsets and Ads data.`,\n\n invoke: {\n src: 'getAdsetsAdsDataService',\n id: 'getAdsetsAdsDataService',\n onDone: {\n target: 'checkResetsState',\n actions: ['saveAdsetsDataAction', 'saveAdsDataAction'],\n },\n onError: {\n target: 'idleState',\n actions: 'getDataMessageErrorAction',\n },\n },\n },\n\n checkResetsState: {\n invoke: {\n src: 'checkResetsCallback',\n id: 'checkResetsCallback',\n },\n\n on: {\n RESET_ADSETS_ADS_OFFSET_EVENT: {\n target: 'getAdsetsAdsDataState',\n actions: 'resetsAction',\n },\n\n RESET_ADS_OFFSET_EVENT: {\n target: 'getAdsDataState',\n actions: 'resetsAction',\n },\n\n RESET_CAMPAIGNS_ADSETS_ADS_OFFSET_EVENT: {\n target: 'getCampaignsAdsetsAdsDataState',\n actions: 'resetsAction',\n },\n\n RESET_CAMPAIGNS_OFFSET_EVENT: {\n target: 'getCampaignsDataState',\n actions: 'resetsAction',\n },\n\n RESET_ADSETS_OFFSET_EVENT: {\n target: 'getAdsetsDataState',\n actions: 'resetsAction',\n },\n\n CONTINUE_TO_IDLE_EVENT: {\n target: 'idleState',\n actions: ['resetsAction'],\n },\n },\n },\n },\n\n initial: 'idleState',\n },\n },\n\n predictableActionArguments: true,\n\n on: {\n RESET_TO_DEFAULT_EVENT: {\n actions: 'resetToDefaultAction',\n internal: false,\n },\n CAMPAIGN_CLICK_EVENT: {\n actions: ['setSelectedCampaignsAction', 'setTabAction'],\n description: `Event fired when a user clicks on campaign name.`,\n target: '.getDataState.getAdsetsAdsDataState',\n internal: false,\n },\n ADSET_CLICK_EVENT: {\n actions: ['setSelectedAdsetsAction', 'setTabAction'],\n description: `Event fired when a user clicks on adset name.`,\n target: '.getDataState.getAdsDataState',\n internal: false,\n },\n SET_SELECTED_CAMPAIGNS_EVENT: {\n actions: ['setSelectedCampaignsAction'],\n description: `Event fired when a user selects one or more campaigns.`,\n target: '.getDataState.getAdsetsAdsDataState',\n internal: false,\n },\n\n SET_SELECTED_ADSETS_EVENT: {\n actions: ['setSelectedAdsetsAction'],\n description: `Event fired when a user selects one or more adsets.`,\n target: '.getDataState.getAdsDataState',\n internal: false,\n },\n\n SET_SELECTED_ADS_EVENT: {\n actions: ['setSelectedAdsAction'],\n description: `Event fired when a user selects one or more ads.`,\n target: '#dashboardMachine',\n internal: false,\n },\n\n CLEAR_SELECTED_ADS_EVENT: {\n target: '#dashboardMachine',\n internal: false,\n description: `Event fired when a user clears selected ads.`,\n actions: ['clearSelectedAdsAction'],\n },\n\n CLEAR_SELECTED_ADSETS_EVENT: {\n target: '.getDataState.getAdsDataState',\n internal: false,\n description: `Event fired when a user clears selected adsets.`,\n actions: ['clearSelectedAdsetsAction'],\n },\n\n CLEAR_SELECTED_CAMPAIGNS_EVENT: {\n target: '.getDataState.getAdsetsAdsDataState',\n description: `Event fired when a user clears selected campaigns.`,\n actions: ['clearSelectedCampaignsAction'],\n internal: false,\n },\n\n SET_TAB_EVENT: {\n target: '#dashboardMachine',\n description: `Event fired when a user clicks on a tab.`,\n internal: false,\n actions: 'setTabAction',\n },\n\n SET_LIMIT_EVENT: {\n target: '.getDataState.getCampaignsAdsetsAdsDataState',\n description: `Event fired when the user selects how many campaigns/adsets/ads to display at once. This value is used for all tabs.`,\n actions: 'setLimitAction',\n internal: false,\n },\n\n SET_CAMPAIGNS_TABLE_OFFSET_EVENT: {\n target: '.getDataState.getCampaignsDataState',\n internal: false,\n description: `Event fired when a user sets the offset (pagination) of the campaigns table.`,\n actions: 'setCampaignsTableOffsetAction',\n },\n\n SET_ADSETS_TABLE_OFFSET_EVENT: {\n target: '.getDataState.getAdsetsDataState',\n internal: false,\n description: `Event fired when a user sets the offset (pagination) of the adsets table.`,\n actions: 'setAdsetsTableOffsetAction',\n },\n\n SET_ADS_TABLE_OFFSET_EVENT: {\n target: '.getDataState.getAdsDataState',\n internal: false,\n description: `Event fired when a user sets the offset (pagination) of the ads table.`,\n actions: 'setAdsTableOffsetAction',\n },\n\n SET_AD_ACCOUNTS_EVENT: {\n target: '.getDataState.getCampaignsAdsetsAdsDataState',\n description: `Event fired when a user sets the selected ad account(s).`,\n actions: 'setAdAccountsAction',\n internal: false,\n },\n\n SET_DATE_RANGE_EVENT: {\n target: '.getDataState.getCampaignsAdsetsAdsDataState',\n description: `Event fired when a user sets the selected date range in the date picker dropdown.`,\n actions: 'setDateRangeAction',\n internal: false,\n },\n\n SET_ATTRIBUTION_SETTINGS_EVENT: {\n target: '.getDataState.getCampaignsAdsetsAdsDataState',\n description: `Event fired when a user sets the selected attribution settings.`,\n actions: 'setAttributionSettingAction',\n internal: false,\n },\n\n SET_SEARCH_EVENT: {\n target: '.getDataState.getCampaignsAdsetsAdsDataState',\n description: `Event fired when a user types to set a search query in the search bar for the campaigns, adsets, and ads attribution tables.`,\n actions: 'setSearchAction',\n internal: false,\n },\n\n SET_REFRESH_EVENT: {\n target: '.getDataState.getCampaignsAdsetsAdsDataState',\n description: `Event fired when a user clicks the refresh button.`,\n actions: ['setRefreshAction'],\n internal: false,\n },\n\n // V2\n SET_CAMPAIGNS_TABLE_FILTERS_EVENT: {\n target: '.getDataState.getCampaignsDataState',\n description: `V2: Event fired when a user sets filters for the campaigns attribution table tab.`,\n actions: 'setCampaignsTableFiltersAction',\n internal: false,\n },\n\n SET_ADSETS_TABLE_FILTERS_EVENT: {\n target: '.getDataState.getAdsetsDataState',\n actions: 'setAdsetsTableFiltersAction',\n description: `V2: Event fired when a user sets filters for the adsets attribution table tab.`,\n internal: false,\n },\n\n SET_ADS_TABLE_FILTERS_EVENT: {\n target: '.getDataState.getAdsDataState',\n description: `V2: Event fired when a user sets filters for the ads attribution table tab.`,\n actions: 'setAdsTableFiltersAction',\n internal: false,\n },\n\n SET_CAMPAIGNS_TABLE_SORT_EVENT: {\n target: '.getDataState.getCampaignsDataState',\n description: `Event fired when a user sets the campaigns table column sorting.`,\n actions: 'setCampaignsTableSortAction',\n internal: false,\n },\n\n SET_ADSETS_TABLE_SORT_EVENT: {\n target: '.getDataState.getAdsetsDataState',\n description: `Event fired when a user sets the adsets table column sorting.`,\n actions: 'setAdsetsTableSortAction',\n internal: false,\n },\n\n SET_ADS_TABLE_SORT_EVENT: {\n target: '.getDataState.getAdsDataState',\n actions: 'setAdsTableSortAction',\n description: `Event fired when a user sets the ads table column sorting.`,\n internal: false,\n },\n\n SET_CAMPAIGNS_TABLE_COLUMNS_EVENT: {\n target: '.getDataState.getCampaignsDataState',\n description: `Event fired when a user sets the displayed campaigns table columns.`,\n actions: 'setCampaignsTableColumnsAction',\n internal: false,\n },\n\n SET_ADSETS_TABLE_COLUMNS_EVENT: {\n target: '.getDataState.getAdsetsDataState',\n actions: 'setAdsetsTableColumnsAction',\n description: `Event fired when a user sets the displayed adsets table columns.`,\n internal: false,\n },\n\n SET_ADS_TABLE_COLUMNS_EVENT: {\n target: '.getDataState.getAdsDataState',\n actions: 'setAdsTableColumnsAction',\n description: `Event fired when a user sets the displayed ads table columns.`,\n internal: false,\n },\n },\n\n type: 'parallel',\n },\n {\n services: {\n checkResetsCallback: (context, event) => (callback: any, onReceive) => {\n const selectedCampaignKeys = context.selectedCampaigns\n const campaigns = context.data.campaignsQuery?.campaigns\n let existingCampaignKeys: RowKey[] = []\n if (selectedCampaignKeys.length > 0 && campaigns) {\n existingCampaignKeys = selectedCampaignKeys.filter((key) => campaigns.some((campaign) => campaign.id === key))\n }\n\n const selectedAdsetKeys = context.selectedAdsets\n const adsets = context.data.adsetsQuery?.adsets\n let existingAdsetKeys: RowKey[] = []\n if (selectedAdsetKeys.length > 0 && adsets) {\n existingAdsetKeys = selectedAdsetKeys.filter((key) => adsets.some((adset) => adset.id === key))\n }\n\n const selectedAdKeys = context.selectedAds\n const ads = context.data.adsQuery?.ads\n let existingAdKeys: RowKey[] = []\n if (selectedAdKeys.length > 0 && ads) {\n existingAdKeys = selectedAdKeys.filter((key) => ads.some((ad) => ad.id === key))\n }\n\n const campaignsTotal = context.data.campaignsQuery?.total ?? 0\n const adsetsTotal = context.data.adsetsQuery?.total ?? 0\n const adsTotal = context.data.adsQuery?.total ?? 0\n const limit = context.limit\n\n const resetCampaignsOffset = context.offset.campaigns > (Math.ceil(campaignsTotal / limit) || 1)\n const resetAdsetsOffset = context.offset.adsets > (Math.ceil(adsetsTotal / limit) || 1)\n const resetAdsOffset = context.offset.ads > (Math.ceil(adsTotal / limit) || 1)\n\n let eventName = ''\n\n if (resetCampaignsOffset || resetAdsetsOffset || resetAdsOffset) {\n if (resetCampaignsOffset && !resetAdsetsOffset && !resetAdsOffset) {\n eventName = 'RESET_CAMPAIGNS_OFFSET_EVENT'\n } else if (!resetCampaignsOffset && resetAdsetsOffset && !resetAdsOffset) {\n eventName = 'RESET_ADSETS_OFFSET_EVENT'\n } else if (!resetCampaignsOffset && !resetAdsetsOffset && resetAdsOffset) {\n eventName = 'RESET_ADS_OFFSET_EVENT'\n } else if (!resetCampaignsOffset && resetAdsetsOffset && resetAdsOffset) {\n eventName = 'RESET_ADSETS_ADS_OFFSET_EVENT'\n } else {\n eventName = 'RESET_CAMPAIGNS_ADSETS_ADS_OFFSET_EVENT'\n }\n } else {\n eventName = 'CONTINUE_TO_IDLE_EVENT'\n }\n callback({\n type: eventName,\n resetCampaignsOffset,\n resetAdsetsOffset,\n resetAdsOffset,\n selectedCampaigns: existingCampaignKeys,\n selectedAdsets: existingAdsetKeys,\n selectedAds: existingAdKeys,\n })\n },\n getCampaignsAdsetsAdsDataService: async ({ limit, offset, dateRange, sort, adAccounts, search, selectedCampaigns, selectedAdsets, attributionSetting, refresh }, event) => {\n const input = {\n limit,\n dateRange: {\n startDate: dateRange?.start,\n endDate: dateRange?.end,\n },\n foxTraxAttribution: attributionSetting.foxtraxAttribution,\n facebookAttribution: attributionSetting.facebookAttribution,\n }\n\n const response: ApolloQueryResult = await apolloClient.query({\n query: CampaignsAdsetsAdsByAdManagerAccountIdsDocument,\n variables: {\n ids: adAccounts,\n campaignsInput: {\n ...input,\n search: getValuesByKey(search, 'CAMPAIGNS'),\n offset: offset.campaigns,\n sort: sort.campaigns,\n },\n adsetsInput: {\n ...input,\n search: getValuesByKey(search, 'ADSETS'),\n campaignSearch: getValuesByKey(search, 'CAMPAIGNS'),\n offset: offset.adsets,\n sort: sort.adsets,\n selectedCampaignIds: selectedCampaigns.length > 0 ? selectedCampaigns : null,\n },\n adsInput: {\n ...input,\n search: getValuesByKey(search, 'ADS'),\n adsetSearch: getValuesByKey(search, 'ADSETS'),\n campaignSearch: getValuesByKey(search, 'CAMPAIGNS'),\n offset: offset.ads,\n sort: sort.ads,\n selectedCampaignIds: selectedCampaigns.length > 0 ? selectedCampaigns : null,\n selectedAdsetIds: selectedAdsets.length > 0 ? selectedAdsets : null,\n },\n },\n fetchPolicy: 'network-only',\n })\n if (refresh) {\n message.success('Data refreshed successfully')\n }\n return response.data\n },\n getAdsetsAdsDataService: async ({ limit, offset, dateRange, sort, adAccounts, search, selectedCampaigns, selectedAdsets, attributionSetting }) => {\n const input = {\n limit,\n dateRange: {\n startDate: dateRange?.start,\n endDate: dateRange?.end,\n },\n foxTraxAttribution: attributionSetting.foxtraxAttribution,\n facebookAttribution: attributionSetting.facebookAttribution,\n }\n\n const response: ApolloQueryResult = await apolloClient.query({\n query: AdsetsAdsByAdManagerAccountIdsDocument,\n variables: {\n ids: adAccounts,\n adsetsInput: {\n ...input,\n search: getValuesByKey(search, 'ADSETS'),\n campaignSearch: getValuesByKey(search, 'CAMPAIGNS'),\n offset: offset.adsets,\n sort: sort.adsets,\n selectedCampaignIds: selectedCampaigns.length > 0 ? selectedCampaigns : null,\n },\n adsInput: {\n ...input,\n search: getValuesByKey(search, 'ADS'),\n adsetSearch: getValuesByKey(search, 'ADSETS'),\n campaignSearch: getValuesByKey(search, 'CAMPAIGNS'),\n offset: offset.ads,\n sort: sort.ads,\n selectedCampaignIds: selectedCampaigns.length > 0 ? selectedCampaigns : null,\n selectedAdsetIds: selectedAdsets.length > 0 ? selectedAdsets : null,\n },\n },\n fetchPolicy: 'network-only',\n })\n return response.data\n },\n getCampaignsDataService: async ({ limit, offset, dateRange, sort, adAccounts, search, attributionSetting }) => {\n const response: ApolloQueryResult = await apolloClient.query({\n query: CampaignsByAdManagerAccountIdsDocument,\n variables: {\n ids: adAccounts,\n input: {\n limit,\n offset: offset.campaigns,\n dateRange: {\n startDate: dateRange?.start,\n endDate: dateRange?.end,\n },\n sort: sort.campaigns,\n foxTraxAttribution: attributionSetting.foxtraxAttribution,\n facebookAttribution: attributionSetting.facebookAttribution,\n search: getValuesByKey(search, 'CAMPAIGNS'),\n },\n },\n fetchPolicy: 'network-only',\n })\n return response.data\n },\n getAdsetsDataService: async ({ limit, offset, dateRange, sort, adAccounts, search, selectedCampaigns, attributionSetting }) => {\n const response: ApolloQueryResult = await apolloClient.query({\n query: AdsetsByAdManagerAccountIdsDocument,\n variables: {\n ids: adAccounts,\n input: {\n limit,\n offset: offset.adsets,\n dateRange: {\n startDate: dateRange?.start,\n endDate: dateRange?.end,\n },\n sort: sort.adsets,\n foxTraxAttribution: attributionSetting.foxtraxAttribution,\n facebookAttribution: attributionSetting.facebookAttribution,\n selectedCampaignIds: selectedCampaigns.length > 0 ? selectedCampaigns : null,\n search: getValuesByKey(search, 'ADSETS'),\n campaignSearch: getValuesByKey(search, 'CAMPAIGNS'),\n },\n },\n fetchPolicy: 'network-only',\n })\n return response.data\n },\n getAdsDataService: async ({ limit, offset, dateRange, sort, adAccounts, search, selectedCampaigns, selectedAdsets, attributionSetting }) => {\n const response: ApolloQueryResult = await apolloClient.query({\n query: AdsByAdManagerAccountIdsDocument,\n variables: {\n ids: adAccounts,\n input: {\n limit,\n offset: offset.ads,\n dateRange: {\n startDate: dateRange?.start,\n endDate: dateRange?.end,\n },\n sort: sort.ads,\n foxTraxAttribution: attributionSetting.foxtraxAttribution,\n facebookAttribution: attributionSetting.facebookAttribution,\n selectedCampaignIds: selectedCampaigns.length > 0 ? selectedCampaigns : null,\n selectedAdsetIds: selectedAdsets.length > 0 ? selectedAdsets : null,\n search: getValuesByKey(search, 'ADS'),\n adsetSearch: getValuesByKey(search, 'ADSETS'),\n campaignSearch: getValuesByKey(search, 'CAMPAIGNS'),\n },\n },\n fetchPolicy: 'network-only',\n })\n return response.data\n },\n },\n actions: {\n resetToDefaultAction: assign((_context, _event) => ({\n ...dashboardContext,\n })),\n saveAdsetsDataAction: assign((context, event) => ({\n data: {\n ...context.data,\n adsetsQuery: event.data.adsetsByAdManagerAccountIds ?? context.data.adsetsQuery,\n },\n })),\n saveAdsDataAction: assign((context, event) => ({\n data: {\n ...context.data,\n adsQuery: event.data.adsByAdManagerAccountIds ?? context.data.adsQuery,\n },\n })),\n saveCampaignsDataAction: assign((context, event) => ({\n data: {\n ...context.data,\n campaignsQuery: event.data.campaignsByAdManagerAccountIds ?? context.data.campaignsQuery,\n },\n })),\n getDataMessageErrorAction: (c, error) => {\n /// Removing for now to avoid cluttering the UI with error messages\n // message.error('Error fetching data')\n console.log(error, \"________________\")\n },\n resetsAction: assign((context, event: any) => ({\n offset: {\n ...context.offset,\n campaigns: event.resetCampaignsOffset ? 1 : context.offset.campaigns,\n adsets: event.resetAdsetsOffset ? 1 : context.offset.adsets,\n ads: event.resetAdsOffset ? 1 : context.offset.ads,\n },\n selectedCampaigns: event.selectedCampaigns ?? { keys: [], rows: [] },\n selectedAdsets: event.selectedAdsets ?? { keys: [], rows: [] },\n selectedAds: event.selectedAds ?? { keys: [], rows: [] },\n })),\n setSelectedCampaignsAction: assign((context, event: any) => ({\n selectedCampaigns: event.selectedCampaigns ?? context.selectedCampaigns,\n })),\n setSelectedAdsetsAction: assign((_context, event: any) => ({\n selectedAdsets: event.selectedAdsets ?? event.selectedAdsets,\n })),\n setSelectedAdsAction: assign((_context, event: any) => ({\n selectedAds: event.selectedAds ?? event.selectedAds,\n })),\n clearSelectedCampaignsAction: assign(() => ({\n selectedCampaigns: [],\n })),\n clearSelectedAdsetsAction: assign(() => ({\n selectedAdsets: [],\n })),\n clearSelectedAdsAction: assign(() => ({\n selectedAds: [],\n })),\n setLimitAction: assign((context, event: any) => ({\n limit: event.limit ?? context.limit,\n })),\n setTabAction: assign((context, event: any) => ({\n tab: event.tab ?? context.tab,\n })),\n setCampaignsTableOffsetAction: assign((context, event: any) => {\n const reset = context.selectedCampaigns.length > 0\n\n return {\n offset: {\n ...context.offset,\n campaigns: event.offset ?? context.offset.campaigns,\n },\n selectedAdsets: reset ? [] : context.selectedAdsets,\n selectedAds: reset ? [] : context.selectedAds,\n }\n }),\n setAdsetsTableOffsetAction: assign((context, event: any) => {\n const reset = context.selectedAdsets.length > 0\n\n return {\n offset: {\n ...context.offset,\n adsets: event.offset ?? context.offset.adsets,\n },\n selectedAds: reset ? [] : context.selectedAds,\n }\n }),\n setAdsTableOffsetAction: assign((context, event: any) => ({\n offset: { ...context.offset, ads: event.offset ?? context.offset.ads },\n })),\n setAdAccountsAction: assign((context, event: any) => ({\n adAccounts: event.adAccounts ?? context.adAccounts,\n })),\n setDateRangeAction: assign((context, event: any) => ({\n dateRange: event.dateRange ?? context.dateRange,\n })),\n setSearchAction: assign((context, event: any) => ({\n search: event.search ?? context.search,\n })),\n setRefreshAction: assign((context, event: any) => ({\n refresh: event.hasOwnProperty('refresh') ? event.refresh : context.refresh,\n })),\n\n // V2\n setCampaignsTableFiltersAction: assign((context, event: any) => ({\n filters: { ...context.filters, campaigns: event.filters ?? context.filters.campaigns },\n })),\n setAdsetsTableFiltersAction: assign((context, event: any) => ({\n filters: { ...context.filters, adsets: event.filters ?? context.filters.adsets },\n })),\n setAdsTableFiltersAction: assign((context, event: any) => ({\n filters: { ...context.filters, ads: event.filters ?? context.filters.ads },\n })),\n setCampaignsTableSortAction: assign((context, event: any) => ({\n sort: { ...context.sort, campaigns: event.sort ?? context.sort.campaigns },\n })),\n setAdsetsTableSortAction: assign((context, event: any) => ({\n sort: { ...context.sort, adsets: event.sort ?? context.sort.adsets },\n })),\n setAdsTableSortAction: assign((context, event: any) => ({\n sort: { ...context.sort, ads: event.sort ?? context.sort.ads },\n })),\n setCampaignsTableColumnsAction: assign((context, event: any) => ({\n columns: { ...context.columns, campaigns: event.columns ?? context.columns.campaigns },\n })),\n setAdsetsTableColumnsAction: assign((context, event: any) => ({\n columns: { ...context.columns, adsets: event.columns ?? context.columns.adsets },\n })),\n setAdsTableColumnsAction: assign((context, event: any) => ({\n columns: { ...context.columns, ads: event.columns ?? context.columns.ads },\n })),\n setAttributionSettingAction: assign((context, event: any) => ({\n attributionSetting: {\n foxtraxAttribution: event.attributionSetting.foxtraxAttribution ?? context.attributionSetting.foxtraxAttribution,\n facebookAttribution: event.attributionSetting.facebookAttribution ?? context.attributionSetting.facebookAttribution,\n },\n })),\n },\n guards: {\n // guard implementations\n },\n },\n )\n","import { ReactNode, createContext } from 'react'\nimport { useInterpret } from '@xstate/react'\nimport { DashboardMachineState, dashboardMachine } from '../machines/dashboardMachine/dashboardMachine'\nimport { InterpreterFrom } from 'xstate'\nimport { localStorageGetItem, localStorageRemoveItem, localStorageSetItem } from '../services/storage'\nimport { LocalStorageKeys } from '../common/types/localStorage'\n\nexport const GlobalStateContext = createContext({ dashboardService: {} as InterpreterFrom })\n\ntype GlobalStateProviderProps = {\n children: ReactNode\n}\n\nexport const storePersistedState = (state: any) => {\n localStorageSetItem(LocalStorageKeys.PersistedState, JSON.stringify(state))\n}\n\nexport const getPersistedState = () => {\n let state = null\n try {\n const item = localStorageGetItem(LocalStorageKeys.PersistedState)\n if (item === null) return null\n\n const parsedItem = JSON.parse(item)\n if (parsedItem === null || Array.isArray(parsedItem) || typeof parsedItem !== 'object') {\n throw new Error(`Invalid Persisted State for key: ${LocalStorageKeys.PersistedState}`)\n }\n state = parsedItem\n } catch (error) {\n console.error(error)\n localStorageRemoveItem(LocalStorageKeys.PersistedState)\n }\n return state\n}\n\n\nexport const GlobalStateProvider = (props: GlobalStateProviderProps) => {\n const state: DashboardMachineState = getPersistedState()\n\n const dashboardService = useInterpret(\n dashboardMachine(state?.context),\n {\n devTools: import.meta.env.DEV,\n state,\n },\n state => storePersistedState(state),\n )\n\n return {props.children}\n}\n","import { ReloadOutlined } from '@ant-design/icons'\nimport { Button, Row, Tooltip, Typography, theme } from 'antd'\nimport { useContext, useEffect } from 'react'\nimport { GlobalStateContext } from '../../../contexts/GlobalStateContext'\nimport { useSelector } from '@xstate/react'\nimport { DashboardMachineState } from '../../../machines/dashboardMachine/dashboardMachine'\nconst { Text } = Typography\n\nconst refreshSelector = (state: DashboardMachineState) => state.context.refresh\nexport const ReloadAction = () => {\n const globalServices = useContext(GlobalStateContext)\n const { send } = globalServices.dashboardService\n const refresh = useSelector(globalServices.dashboardService, refreshSelector)\n const setRefresh = (refresh: boolean) => send({ type: 'SET_REFRESH_EVENT', refresh })\n const {\n token: { colorPrimaryBg, colorTextBase },\n } = theme.useToken()\n\n useEffect(() => {\n setRefresh(false)\n }, [])\n\n return (\n \n \n Refresh\n \n \n Click on it to refresh your page\n \n \n }\n >\n {\n setRefresh(true)\n setTimeout(() => {\n setRefresh(false)\n }, 2000)\n }}\n loading={refresh}\n type=\"text\"\n icon={}\n >\n \n )\n}\n","export default \"__VITE_ASSET__544a3185__\"","import { useContext, useEffect, useMemo } from 'react'\nimport { Typography, theme, TreeSelect as _TreeSelect, Avatar, Space } from 'antd'\nimport styled from 'styled-components'\nimport { Key, useState } from 'react'\nimport { DownOutlined } from '@ant-design/icons'\nimport facebookIcon from '../../../assets/fb.png'\nimport { useSelector } from '@xstate/react'\nimport { GlobalStateContext } from '../../../contexts/GlobalStateContext'\nimport { DashboardMachineState } from '../../../machines/dashboardMachine/dashboardMachine'\nimport { JwtContext } from '../../../contexts/jwtContext'\nimport { useAdManagerAccountsByStoreIdLazyQuery } from '../../../__generated__/graphql'\nimport './style.css'\ninterface AdPlatformAccount {\n accounts: {\n id: string\n sourceAdManagerAccountId: string\n title: string\n }[]\n icon: string\n name: string\n}\nconst { Text } = Typography\n\nconst { Group: AvatarGroup } = Avatar\n\nconst DropdownWrapper = styled.div`\n padding: 0 8px;\n .ant-select-tree-checkbox {\n margin-block-start: 8px !important;\n }\n .ant-select-tree-list-holder-inner > div::before {\n content: '';\n height: 36px;\n }\n .ant-select-tree-treenode {\n width: 100%;\n }\n .ant-select-tree-treenode > :nth-child(2) {\n order: 1 !important;\n }\n .ant-select-tree-switcher {\n transform: translate(0, 6px);\n }\n .ant-select-tree-treenode {\n align-items: center !important;\n }\n .ant-select-tree-node-content-wrapper:hover {\n background: none !important;\n }\n`\n\nconst TreeSelect = styled(_TreeSelect)`\n height: 40px;\n .ant-select-selector {\n border-radius: 12px !important;\n }\n .ant-select-selection-item {\n background: white !important;\n border: none !important;\n padding: 2px !important;\n }\n`\nconst AdPlatformLabel = styled(Text)`\n font-weight: 600;\n font-size: 17px;\n`\nconst AdPlatformSub = styled(Text)`\n font-weight: 400;\n font-size: 17px;\n color: ${(props) => props.color};\n`\n\nconst AdPlatformIcon = styled.img`\n width: 32px;\n vertical-align: middle;\n`\n\nconst AdAccount = styled(Space)`\n & > * {\n height: 18px;\n }\n`\n\nconst AdAccountTitle = styled(Text)`\n font-weight: 600;\n font-size: 15px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 150px;\n`\n\nconst AdAccountSubtitle = styled(Text)`\n font-weight: 400;\n font-size: 13px;\n color: ${(props) => props.color};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 150px;\n`\nconst adAccountsSelector = (state: DashboardMachineState) => state.context.adAccounts\n\nexport const AdPlatformAction = () => {\n const globalServices = useContext(GlobalStateContext)\n const { send } = globalServices.dashboardService\n const [adAccountData, setAdAccountData] = useState([])\n const adAccounts = useSelector(globalServices.dashboardService, adAccountsSelector)\n\n const setAdAccounts = (adAccounts: string[]) => send({ type: 'SET_AD_ACCOUNTS_EVENT', adAccounts })\n const decodedToken = useContext(JwtContext)\n const [getAdManagerAccounts, { data }] = useAdManagerAccountsByStoreIdLazyQuery()\n useEffect(() => {\n getAdManagerAccounts({\n variables: {\n id: decodedToken?.stores[0] ?? '',\n },\n fetchPolicy: 'network-only'\n })\n }, [decodedToken])\n useEffect(() => {\n if (data && (data.adManagerAccountsByStoreId?.length || 0) > 0) {\n const adManagerAccounts = [\n {\n icon: facebookIcon,\n name: 'Facebook',\n accounts: (data.adManagerAccountsByStoreId || []).map(({ id, name, sourceAdManagerAccountId }) => ({\n id: id,\n sourceAdManagerAccountId: sourceAdManagerAccountId,\n title: name,\n })),\n },\n ]\n setAdAccountData(adManagerAccounts)\n if (adAccounts.length > 0) {\n const validAdAccounts = adAccounts.filter((accountId) => data.adManagerAccountsByStoreId?.some((account) => account.id === accountId))\n setAdAccounts(validAdAccounts)\n } else {\n setAdAccounts(data.adManagerAccountsByStoreId?.map((account) => account.id) ?? [])\n }\n }\n }, [data])\n\n const {\n token: { colorTextTertiary },\n } = theme.useToken()\n\n const [expandedKeys, setExpandedKeys] = useState([])\n\n const handleExpand = (expandedKeys: Key[]) => {\n const latestExpandedKey = expandedKeys.pop()\n if (latestExpandedKey) {\n setExpandedKeys([latestExpandedKey])\n } else {\n setExpandedKeys([])\n }\n }\n const handleChange = (newValue: unknown) => {\n setAdAccounts(newValue as string[])\n }\n\n const icons = useMemo(() => {\n const foundIcons = new Set()\n adAccounts.forEach((id: string) => {\n adAccountData?.forEach((obj) => {\n obj.accounts.forEach((account) => {\n if (account.id === id) {\n foundIcons.add(obj.icon)\n }\n })\n })\n })\n return Array.from(foundIcons)\n }, [adAccountData, adAccounts])\n\n \n\n const treeData = adAccountData?.map(({ name, icon, accounts }) => {\n return {\n key: name, // Assigning 'name' as the key for the top-level node\n value: name,\n title: (\n \n \n \n {name} ({accounts.length})\n \n \n ),\n children: accounts.map(({ id, sourceAdManagerAccountId, title }) => {\n return {\n value: id,\n key: id,\n title: (\n \n {title}\n ID: {sourceAdManagerAccountId}\n \n ),\n }\n }),\n }\n })\n\n return (\n 0 && (\n \n {icons.length > 0 && (\n \n {icons.map((icon, index) => (\n \n ))}\n \n )}\n \n {adAccounts?.length} Ad Account{adAccounts?.length === 1 ? '' : 's'}\n \n \n )\n }\n switcherIcon={}\n style={{ width: '200px' }}\n value={adAccountData && adAccountData.length > 0 ? adAccounts : []}\n dropdownStyle={{ maxHeight: 'auto', minWidth: '300px' }}\n placeholder=\"Select Ad Account(s)\"\n allowClear\n multiple\n dropdownRender={(node) => {\n return {node}\n }}\n treeDefaultExpandAll\n onChange={handleChange}\n treeData={treeData}\n />\n )\n}\n","export const BrowserWindowIcon = () => {\n return (\n \n \n \n \n \n \n )\n}\n","export const FolderIcon = () => {\n return (\n \n \n \n )\n}\n","export const PromotionIcon = () => {\n return (\n \n \n \n \n )\n}\n","import styled from \"styled-components\";\n\nexport const BackButton = styled.img`\n height: 24;\n width: 24;\n position: absolute;\n top: 0;\n left: 0;\n margin-top: 24px;\n margin-bottom: 24px;\n margin-left: 32px;\n cursor: pointer;\n`;","import { Button as _Button } from \"antd\";\nimport styled from \"styled-components\";\nexport const Button = styled(_Button)`\n height: 62px;\n font-weight: 700;\n font-size: 16px;\n border-radius: 14px;\n`;","export const breakpoints = {\n xs: '480px',\n sm: '576px',\n md: '768px',\n lg: '992px',\n xl: '1200px',\n xxl: '1600px',\n}\n\nexport const antdScreenSizes: { [key: string]: number } = {\n screenLG: 992,\n screenLGMax: 1199,\n screenLGMin: 992,\n screenMD: 768,\n screenMDMax: 991,\n screenMDMin: 768,\n screenSM: 576,\n screenSMMax: 767,\n screenSMMin: 576,\n screenXL: 1200,\n screenXLMax: 1599,\n screenXLMin: 1200,\n screenXS: 480,\n screenXSMax: 575,\n screenXSMin: 480,\n screenXXL: 1600,\n screenXXLMin: 1600,\n}\n","import styled from \"styled-components\";\nimport { Card as _Card } from \"antd\";\nimport { breakpoints } from \"../../theme/breakpoints\";\n\nexport const Card = styled(_Card)`\n max-width: 540px;\n margin: auto;\n padding: 0 16px;\n @media (max-width: ${breakpoints.sm}){\n height: 100%;\n display: flex; \n justify-content: center; \n align-items: center \n }\n`;","import { Form } from \"antd\";\nimport styled\n from \"styled-components\";\nimport { colorTextTertiary } from \"../../theme/colors\";\nconst _FormItem = Form.Item;\n\nexport const FormItem = styled(_FormItem)`\n .ant-form-item-label > label {\n color: ${colorTextTertiary};\n font-size: 12px;\n font-weight: 500;\n line-height: 20px;\n }\n`;","import { Input as _Input } from \"antd\";\nimport styled from \"styled-components\";\n\nexport const Input = styled(_Input)`\n height: 62px;\n border-radius: 15px;\n`;\n\nexport const InputPassword = styled(_Input.Password)`\n height: 62px;\n border-radius: 15px;\n`;","import styled from \"styled-components\";\n\nexport const Background = styled.div<{src:string, offset?:string, scale?:string}>`\n background-image: url(${(props)=>props.src});\n min-height: 100%;\n background-size: cover;\n position: relative;\n background-position: center ${(props)=> props.offset ? props.offset : '0'};\n background-size: ${(props)=> props.scale ? props.scale : 'cover'};\n background-repeat: no-repeat;\n`;","import styled from \"styled-components\";\nimport { breakpoints } from \"../../theme/breakpoints\";\nexport const Container = styled.div`\n padding: 16px;\n @media (max-width: ${breakpoints.sm}){\n height: 100%;\n margin: auto;\n padding: 0;\n }\n`;","import styled from \"styled-components\";\nimport { Spin as _Spin } from \"antd\";\n\nexport const Spin = styled(_Spin)`\n .ant-spin-dot-item {\n background-color: white;\n }\n`;","import { Button } from 'antd'\nimport styled from 'styled-components'\n\nexport const FilterButton = styled(Button)`\n height: 60px;\n font-size: 16px;\n font-weight: 400;\n border-radius: 12px;\n`\n","import styled from 'styled-components'\nimport { Input as _Input } from 'antd'\nexport const SearchInput = styled(_Input)<{ backgroundcolorsecondary?: string }>`\n fontsize: 17px;\n fontweight: 400;\n height: 40px;\n border: none;\n border-radius: 8px !important;\n .ant-input {\n background-color: ${(props) => props.backgroundcolorsecondary};\n font-size: 17px !important;\n font-weight: 400 !important;\n }\n .ant-input-affix-wrapper-focused,\n .ant-input-affix-wrapper-focus {\n box-shadow: none !important;\n }\n`","import { Typography } from 'antd'\nconst { Text } = Typography\n\ninterface CopyableTextProps {\n text: string\n backgroundColor: string\n showButtonInUpperRight?: boolean\n}\n\nexport const CopyableText = ({ text, backgroundColor, showButtonInUpperRight = false }: CopyableTextProps) => {\n const isMultiLine = text.includes('\\n')\n const textStyle = {\n display: 'flex',\n whiteSpace: 'pre-wrap',\n lineHeight: '1.5',\n justifyContent: isMultiLine && showButtonInUpperRight ? 'flex-start' : 'space-between',\n background: backgroundColor,\n padding: 16,\n borderRadius: 8,\n fontWeight: 500,\n fontSize: 16,\n position: 'relative' as const\n }\n return (\n
\n \n {text}\n \n {isMultiLine && showButtonInUpperRight && (\n \n \n \n )}\n
\n )\n}","import { Tabs as _Tabs } from 'antd'\nimport styled from 'styled-components'\n\ninterface TabsProps {\n colorprimary?: string;\n backgroundcolorsecondary?: string;\n backgroundactive?: string;\n minwidth?: string;\n}\n\nexport const Tabs = styled(_Tabs)`\n padding: 0px !important;\n .ant-tabs-nav {\n z-index: 4;\n margin-bottom: 0 !important;\n }\n .ant-tag-close-icon {\n margin-right: 0 !important;\n }\n .ant-tabs-nav-more {\n display: none;\n }\n .ant-tabs-nav-list {\n overflow: auto;\n }\n .ant-tabs-nav > div:nth-of-type(1) {\n display: unset !important;\n width: 100% !important;\n }\n .ant-tabs-nav::before {\n display: none;\n }\n & > .ant-tabs-nav > .ant-tabs-nav-operations {\n display: none;\n }\n .ant-tabs-nav-list {\n align-items: flex-end;\n }\n .ant-tabs-tab {\n display: inherit;\n overflow: hidden;\n position: relative !important;\n box-shadow: inset rgba(217, 217, 217, 50%) 0px -6px 7px -1px, 0px 2px 8px 0px #00000045;\n margin: 8px 8px 0 8px !important;\n flex: 1;\n text-align: center;\n justify-content: start;\n background-color: ${(props) => props.backgroundcolorsecondary} !important;\n border: none !important;\n transition: all 0s !important;\n min-width: ${(props) => props.minwidth} !important;\n border-radius: 12px 12px 0 0 !important;\n & svg path {\n fill: black;\n }\n background: #FAFAFA !important;\n padding: 8px 8px 8px 12px !important;\n }\n .ant-tabs-tab:hover {\n color: ${(props) => props.colorprimary} !important;\n & svg path {\n fill: ${(props) => props.colorprimary};\n }\n }\n .ant-tabs-tab-btn {\n font-weight: 700;\n font-size: 18px;\n width: 100%;\n background: inherit;\n transition: all 0s !important;\n }\n .ant-tabs-tab-active {\n box-shadow: 0px 2px 8px 0px #00000045; !important;\n background-color: ${(props) => props.backgroundactive} !important;\n height: 44px !important;\n .ant-tabs-tab-btn {\n color: ${(props) => props.colorprimary} !important;\n font-weight: 700;\n font-size: 18px;\n }\n & svg path {\n fill: ${(props) => props.colorprimary};\n }\n }\n .ant-tabs-tab:not(.ant-tabs-tab-active) {\n height: 40px !important;\n }\n @media (max-width: 768px) {\n .ant-tabs-tab {\n justify-content: center !important;\n }\n }\n .ant-tabs-content-holder {\n box-shadow: 0px 2px 8px 0px #00000045;\n }\n`\n","import { CloseCircleFilled as _CloseCircleFilled } from '@ant-design/icons'\nimport { Space, Tag, theme } from 'antd'\nimport styled from 'styled-components'\n\nconst PillWrapper = styled(Space)`\n padding-left: 4px;\n position: absolute;\n right: 0px;\n background: inherit;\n padding-right: 8px;\n`\n\nconst Pill = styled(Tag)`\n padding: 4px 4px 4px 8px;\n border-radius: 100px;\n display: flex;\n font-size: 16px;\n font-weight: 700;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n border: none;\n`\n\nconst CloseCircleFilled = styled(_CloseCircleFilled)`\n svg path {\n fill: white !important;\n }\n`\n\ninterface SelectedPillProps {\n selectedRowCount: number\n clearSelectedRows: () => void\n}\n\nexport const SelectedPill = ({ selectedRowCount, clearSelectedRows }: SelectedPillProps) => {\n const {\n token: { colorPrimary },\n } = theme.useToken()\n\n return (\n \n {selectedRowCount > 0 && (\n \n {selectedRowCount} selected\n {\n e.stopPropagation()\n clearSelectedRows()\n }}\n style={{ marginRight: 0, fontSize: 20 }}\n />\n \n )}\n \n )\n}\n","import Icon from '@ant-design/icons'\nimport { Space as _Space } from 'antd'\nimport { SelectedPill } from './SelectedPill'\nimport styled from 'styled-components'\n\n\nconst TabLabelContainer = styled.div`\n user-select: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: inherit;\n`\nconst Title = styled.span`\n font-size: 18px;\n line-height: 18px !important;\n`\n\nconst Space = styled(_Space)`\n & > .ant-space-item {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n }\n`\n\ninterface TabelLabelProps {\n title: string\n Logo: () => JSX.Element\n selectedRowsCount: number\n clearSelectedRows: () => void\n}\n\nexport const TabLabel = ({ title, Logo, selectedRowsCount, clearSelectedRows }: TabelLabelProps) => {\n return (\n \n \n } />\n {title}\n \n \n \n )\n}\n","export const pluralize = (text: string, length: number) => {\n return length > 1 ? `${text}s` : text\n}\n","import { SorterResult } from 'antd/es/table/interface'\nimport { SortInput, SortDirection } from '../__generated__/graphql'\n\nexport const useMultiSort = (sortState: SortInput[], setSort: (sort: SortInput[]) => void) => {\n const sorterToOrder = (sorter: any): SortInput => ({\n column: sorter.columnKey,\n order: sorter.order === 'ascend' ? SortDirection.Asc : SortDirection.Desc,\n })\n\n // update using antd sorter object\n const updateOrderWithSorter = (sorter: SorterResult | SorterResult[]) => {\n const isMultiSort = Array.isArray(sorter)\n let newOrder\n if (isMultiSort) {\n newOrder = sorter.map(sorterToOrder)\n } else {\n newOrder = sorter.order ? [sorterToOrder(sorter)] : []\n }\n setSort(newOrder)\n }\n\n const getOrderForColumn = (column: string): 'ascend' | 'descend' | null => {\n const orderForColumn = sortState.find((o) => o.column === column)\n if (!orderForColumn) return null\n return orderForColumn.order === SortDirection.Asc ? 'ascend' : 'descend'\n }\n\n return { getOrderForColumn, updateOrderWithSorter }\n}\n","export function formatNumber(value: number, decimals = 2): string {\n return value.toFixed(decimals).replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n}\n","import { DashboardData } from '../components/MetricsContainer'\nimport { AttributionTableTabs, DashboardMachineData, DashboardMachineState } from '../machines/dashboardMachine/dashboardMachine'\n\n// This logic used to help filter the aggregates based on what was selected on the same tab. This might be useful in the future when we have multiple platforms. Talk to Ramley...\n// export const aggregateSelectedItems = (data: any[], selectedRowKeys: RowKey[]) => {\n// return data\n// .filter((row) => selectedRowKeys.includes(row.id))\n// .reduce(\n// (acc, item) => ({\n// spend: (acc.spend ?? 0) + (item.spend ?? 0),\n// orders: (acc.orders ?? 0) + (item.orders ?? 0),\n// sourceOrders: (acc.sourceOrders ?? 0) + (item.sourceOrders ?? 0),\n// ordersValue: (acc.ordersValue ?? 0) + (item.ordersValue ?? 0),\n// sourceOrdersValue: (acc.sourceOrdersValue ?? 0) + (item.sourceOrdersValue ?? 0),\n// }),\n// {} as { [key: string]: number },\n// )\n// }\n\n// export const dataSelector = (state: DashboardMachineState) => {\n// const { selectedCampaigns, selectedAdsets, selectedAds, data } = state.context\n\n// switch (state.context.tab) {\n// case AttributionTableTabs.CAMPAIGNS:\n// return selectedCampaigns.length > 0 ? aggregateSelectedItems(data.campaignsQuery?.campaigns ?? [], selectedCampaigns) : data.campaignsQuery?.aggregates\n// case AttributionTableTabs.ADSETS:\n// return selectedAdsets.length > 0 ? aggregateSelectedItems(data.adsetsQuery?.adsets ?? [], selectedAdsets) : data.adsetsQuery?.aggregates\n// case AttributionTableTabs.ADS:\n// return selectedAds.length > 0 ? aggregateSelectedItems(data.adsQuery?.ads ?? [], selectedAds) : data.adsQuery?.aggregates\n// }\n// }\n\nexport const tableSummaryMetricsSelector = (state: DashboardMachineState) => {\n const { data } = state.context\n\n switch (state.context.tab) {\n case AttributionTableTabs.CAMPAIGNS:\n return tableSummaryMetricsMapper(data.campaignsQuery)\n case AttributionTableTabs.ADSETS:\n return tableSummaryMetricsMapper(data.adsetsQuery)\n case AttributionTableTabs.ADS:\n return tableSummaryMetricsMapper(data.adsQuery)\n }\n}\n\nexport const tableSummaryMetricsMapper = (data: DashboardMachineData['campaignsQuery'] | DashboardMachineData['adsetsQuery'] | DashboardMachineData['adsQuery']): DashboardData => {\n return {\n spend: data?.aggregates.spend ?? 0,\n facebookOrders: data?.aggregates.sourceOrders ?? 0,\n facebookRevenue: data?.aggregates.sourceOrdersValue ?? 0,\n attributedOrders: data?.aggregates.orders ?? 0,\n attributedRevenue: data?.aggregates.ordersValue ?? 0,\n }\n}\n\nexport const cardsMetricsSelector = (state: DashboardMachineState): DashboardData => {\n const { data } = state.context\n return {\n dailyBudget: data.campaignsQuery?.totals.dailyBudget ?? 0,\n orders: data.campaignsQuery?.totals.orders.total ?? 0,\n revenue: data.campaignsQuery?.totals.revenue.total ?? 0,\n spend: data.campaignsQuery?.totals.spend ?? 0,\n facebookOrders: data.campaignsQuery?.totals.orders.facebook ?? 0,\n facebookRevenue: data.campaignsQuery?.totals.revenue.facebook ?? 0,\n attributedOrders: data.campaignsQuery?.totals.orders.attributed ?? 0,\n attributedRevenue: data.campaignsQuery?.totals.revenue.attributed ?? 0,\n organicOrders: data.campaignsQuery?.totals.orders.organic ?? 0,\n organicRevenue: data.campaignsQuery?.totals.revenue.organic ?? 0,\n }\n}\n","import React, { useContext } from 'react'\nimport { Table, Space, Typography } from 'antd'\nimport { colorTextTertiary } from '../../theme/colors'\nimport { formatNumber } from '../../common/utils/formatter'\nimport styled from 'styled-components'\nimport { AttributionTableTabs } from '../../machines/dashboardMachine/dashboardMachine'\nimport { GlobalStateContext } from '../../contexts/GlobalStateContext'\nimport { useSelector } from '@xstate/react'\nimport { tableSummaryMetricsSelector } from '../../utils/dashboard-util'\nimport { pluralize } from '../../utils/pluralize'\nimport { DashboardData } from '../../components/MetricsContainer'\nimport { CustomColumnType } from '../AttributionTables/columns'\n\nconst { Text: _Text } = Typography\nconst { Summary } = Table\n\nconst SummarySpace = styled(Space)`\n gap: 0px !important;\n`\nconst Cell = styled(Summary.Cell)<{ footerbackground: string }>`\n background: ${(props) => props.footerbackground} !important;\n`\n\nconst FixedCell = styled(Cell)`\n z-index: 20 !important;\n`\n\nconst SummaryText = styled(_Text)`\n font-size: 14px;\n font-weight: 600;\n`\n\nconst SummaryMetric = styled(_Text)`\n font-size: 14px;\n font-weight: 400;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`\n\nconst SummaryLabel = styled(_Text)`\n font-size: 12px;\n font-weight: 400;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`\n\nexport const TableSummary = (columns: CustomColumnType[]) => {\n const globalServices = useContext(GlobalStateContext)\n const totals: DashboardData = useSelector(globalServices.dashboardService, tableSummaryMetricsSelector)\n\n let currentTab = AttributionTableTabs.CAMPAIGNS\n let tabName = 'Campaign'\n const totalCount = useSelector(globalServices.dashboardService, (state) => {\n currentTab = state.context.tab\n switch (currentTab) {\n case AttributionTableTabs.CAMPAIGNS:\n tabName = 'Campaign'\n return state.context.data.campaignsQuery?.total ?? 0\n case AttributionTableTabs.ADSETS:\n tabName = 'Adset'\n return state.context.data.adsetsQuery?.total ?? 0\n case AttributionTableTabs.ADS:\n tabName = 'Ad'\n return state.context.data.adsQuery?.total ?? 0\n default:\n return 0\n }\n })\n\n const formattedTotals = {\n dailyBudget: `$${formatNumber(totals?.dailyBudget ?? 0, 2)}`,\n spend: `$${formatNumber(totals?.spend ?? 0, 2)}`,\n attributedOrders: formatNumber(totals?.attributedOrders ?? 0, 0),\n attributedRevenue: `$${formatNumber(totals?.attributedRevenue ?? 0, 2)}`,\n facebookOrders: formatNumber(totals?.facebookOrders ?? 0, 0),\n facebookRevenue: `$${formatNumber(totals?.facebookRevenue ?? 0, 2)}`,\n }\n\n const count = Math.floor(totalCount)\n const summaryTitle = `Results from ${count.toLocaleString()} ${pluralize(tabName, count)}`\n\n return (\n \n \n \n {summaryTitle}\n \n \n {columns.slice(2).map((column, index) => {\n const key = column?.totalsKey as keyof typeof formattedTotals\n const shouldHideTotal = column?.shouldHideTotal\n if (shouldHideTotal) {\n return \n }\n return (\n \n \n {key in formattedTotals ? formattedTotals[key] : '-'}\n {`Total ${column.title}`}\n \n \n )\n })}\n \n \n )\n}\n","import { LeftOutlined, RightOutlined } from '@ant-design/icons'\nimport { Pagination as _Pagination, Row, Select as _Select, Space, Typography, Table as _Table, theme, Col } from 'antd'\nimport { ColumnType, TableRowSelection } from 'antd/es/table/interface'\nimport styled from 'styled-components'\nimport { useCallback } from 'react'\nimport { SortInput } from '../../__generated__/graphql'\nimport { useMultiSort } from '../../utils/useMultiSort'\nimport { TableSummary } from './TableSummary'\nimport { RowKey } from '../../machines/dashboardMachine/dashboardMachine'\nimport { CustomColumnType } from '../AttributionTables/columns'\n\nconst Table = styled(_Table)<{ headerbackground: string; primarycolor: string; colortext: string }>`\n .ant-table-column-title{\n user-select: none;\n },\n .ant-table-thead th.ant-table-column-sort,\n .ant-table-thead .ant-table-cell {\n color: #6f767e !important;\n background: white;\n background-color: ${(props) => props.headerbackground};\n }\n\n .ant-table-tbody > tr > td {\n border-bottom: 1px solid #eeeeee;\n border-right: 0.5px solid #eeeeee;\n }\n\n .ant-table-thead th.ant-table-column-has-sorters {\n &:hover {\n color: ${(props) => props.primarycolor} !important;\n }\n }\n\n th.ant-table-column-sort {\n color: ${(props) => props.primarycolor} !important;\n }\n .ant-table-thead th.ant-table-column-has-sorters::before {\n background-color: #f0f0f0 !important;\n }\n .ant-table-thead th.ant-table-column-has-sorters:hover::before {\n background-color: #f0f0f0 !important;\n }\n\n td.ant-table-column-sort {\n color: ${(props) => props.colortext} !important;\n }\n\n td.ant-table-column-sort:hover {\n color: ${(props) => props.colortext} !important;\n }\n`\n\nconst Select = styled(_Select)`\n height: auto;\n .ant-select-selector {\n border-radius: 100px;\n height: 44px !important;\n padding: 6px 20px !important;\n }\n .ant-select-selection-item::before {\n content: 'Show ';\n }\n`\nconst Pagination = styled(_Pagination)`\n li {\n height: auto !important;\n }\n`\n\nexport interface TableRow {\n key: string\n id: string\n name: string\n status: string\n budget: number\n spend?: number\n on: boolean\n orders?: number | null\n ordersValue?: number | null\n sourceOrders?: number | null\n sourceOrdersValue?: number | null\n}\n\ninterface TableProps {\n title: string\n columns: CustomColumnType[]\n data: TableRow[]\n limit: number\n offset: number\n sort: SortInput[]\n total?: number\n loading?: boolean\n selectedRowKeys: RowKey[]\n setOffset: (offset: number) => void\n setSort: (sort: SortInput[]) => void\n setLimit: (limit: number) => void\n setSelectedRowKeys: (keys: RowKey[]) => void\n}\n\nexport const AttributionTable = ({ columns, data, limit, offset, sort, total, loading, selectedRowKeys, setOffset, setSort, setLimit, setSelectedRowKeys }: TableProps) => {\n const {\n token: { colorBorder, colorBgContainer, colorPrimary, colorText },\n } = theme.useToken()\n\n const { getOrderForColumn, updateOrderWithSorter } = useMultiSort(sort, setSort)\n\n const readiedColumns = columns.map((column) => {\n if (column.sorter !== false) {\n return {\n ...column,\n sorter: { multiple: 1 },\n sortOrder: getOrderForColumn(column.key as string),\n }\n } else {\n return column\n }\n })\n\n const tableItemRender = useCallback(\n (_current: number, type: 'prev' | 'next' | 'page' | 'jump-prev' | 'jump-next', originalElement: React.ReactNode) => {\n if (type === 'prev') {\n return \n }\n if (type === 'next') {\n return \n }\n return originalElement\n },\n [data],\n )\n\n const rowSelection: TableRowSelection = {\n type: 'checkbox',\n selectedRowKeys,\n onChange: (selectedRowKeys: RowKey[]) => setSelectedRowKeys(selectedRowKeys),\n getCheckboxProps: (record: TableRow) => ({\n disabled: record.name === 'Disabled User',\n name: record.name,\n }),\n }\n\n const tableSummary = TableSummary(columns)\n\n return (\n <>\n []}\n dataSource={[...data]}\n pagination={false}\n size=\"middle\"\n rowSelection={rowSelection as TableRowSelection}\n summary={() => tableSummary}\n scroll={{ x: 1000, y: 500 }}\n onChange={(_pagination, _filters, sorter, { action }) => {\n if (action === 'sort') {\n updateOrderWithSorter(sorter)\n }\n }}\n />\n \n \n {\n setOffset(offset)\n }}\n showSizeChanger={false}\n itemRender={tableItemRender}\n />\n \n \n \n \n \n Showing {`${(offset - 1) * limit + 1} to ${(offset - 1) * limit + data.length}`} of {total} entries\n \n setLimit(value as number)}\n value={limit}\n defaultValue={10}\n options={[\n { value: 10, label: '10' },\n { value: 25, label: '25' },\n { value: 50, label: '50' },\n ]}\n >\n \n \n \n \n \n )\n}\n","import { Tag } from 'antd'\nimport { ColumnGroupType, ColumnType } from 'antd/es/table/interface'\nimport { TableRow } from '../AttributionTable'\nimport { RowKey } from '../../machines/dashboardMachine/dashboardMachine'\n\nexport interface CustomColumnType extends ColumnType {\n totalsKey?: string\n shouldHideTotal?: boolean\n}\n\nexport const getColumns = (showDailyBudget = true, onNameClick?: (key: RowKey) => void): (CustomColumnType)[] => {\n const isProduction = import.meta.env.VITE_USER_NODE_ENV === 'production'\n return [\n {\n ellipsis: true,\n width: 240,\n title: 'Name',\n dataIndex: 'name',\n key: 'name',\n fixed: 'left',\n align: 'left',\n render: (text: string, record: TableRow) => {\n return (\n onNameClick && onNameClick(record.key)}>\n {text} {record.id}\n \n )\n },\n },\n {\n ellipsis: true,\n width: 140,\n title: 'Status',\n dataIndex: 'status',\n key: 'status',\n align: 'center',\n render: (text: string) => {\n let color = ''\n if (text === 'ACTIVE') {\n color = 'green'\n } else if (text === 'PAUSED') {\n color = 'grey'\n }\n return {text}\n },\n },\n ...(showDailyBudget\n ? [\n {\n ellipsis: true,\n width: 140,\n title: 'Budget',\n dataIndex: 'budget',\n key: 'dailyBudget',\n shouldHideTotal: true,\n align: 'center' as const,\n render: (text: number) => {\n return text !== null && text !== undefined ? `$${text.toFixed(2)} (Daily)` : '-'\n },\n },\n ]\n : []),\n {\n ellipsis: true,\n width: 140,\n title: 'Spend',\n dataIndex: 'spend',\n key: 'spend',\n totalsKey: 'spend',\n align: 'center',\n render: (text: number) => {\n return text !== null && text !== undefined ? `$${text.toFixed(2)}` : '-'\n },\n },\n {\n ellipsis: true,\n width: 165,\n title: isProduction ? 'Orders' : 'Orders (FoxTrax)',\n dataIndex: 'orders',\n key: 'orders',\n totalsKey: 'attributedOrders',\n align: 'center',\n render: (text: number) => {\n return text !== null && text !== undefined ? text.toLocaleString('en-US') : '-'\n },\n },\n ...(!isProduction\n ? [\n {\n ellipsis: true,\n width: 165,\n title: 'Orders (Facebook)',\n dataIndex: 'sourceOrders',\n key: 'sourceOrders',\n totalsKey: 'facebookOrders',\n align: 'center' as const,\n render: (text: number) => {\n return text !== null && text !== undefined ? text.toLocaleString('en-US') : '-'\n },\n },\n ]\n : []),\n {\n ellipsis: true,\n width: 170,\n title: isProduction ? 'Revenue' : 'Revenue (FoxTrax)',\n dataIndex: 'ordersValue',\n key: 'ordersValue',\n totalsKey: 'attributedRevenue',\n align: 'center',\n render: (text: number) => {\n return
{text !== null && text !== undefined ? `$${text.toFixed(2)}` : '-'}
\n },\n },\n ...(!isProduction\n ? [\n {\n ellipsis: true,\n width: 170,\n title: 'Revenue (Facebook)',\n dataIndex: 'sourceOrdersValue',\n key: 'sourceOrdersValue',\n totalsKey: 'facebookRevenue',\n align: 'center' as const,\n render: (text: number) => {\n return
{text !== null && text !== undefined ? `$${text.toFixed(2)}` : '-'}
\n },\n },\n ]\n : []),\n ]\n}\n","import { useSelector } from '@xstate/react'\nimport { AttributionTableTabs, DashboardMachineState, RowKey } from '../../machines/dashboardMachine/dashboardMachine'\nimport { AttributionTable } from '../AttributionTable'\nimport { SortInput } from '../../__generated__/graphql'\nimport { useContext } from 'react'\nimport { getColumns } from './columns'\nimport { GlobalStateContext } from '../../contexts/GlobalStateContext'\n\nconst selectedCampaignsSelector = (state: DashboardMachineState) => state.context.selectedCampaigns\nconst limitSelector = (state: DashboardMachineState) => state.context.limit\nconst offsetSelector = (state: DashboardMachineState) => state.context.offset.campaigns\nconst sortSelector = (state: DashboardMachineState) => state.context.sort.campaigns\nconst dataSelector = (state: DashboardMachineState) => state.context.data.campaignsQuery\n\nexport const CampaignsTable = () => {\n const globalServices = useContext(GlobalStateContext)\n const { send } = globalServices.dashboardService\n\n const selectedCampaigns = useSelector(globalServices.dashboardService, selectedCampaignsSelector)\n const limit = useSelector(globalServices.dashboardService, limitSelector)\n const offset = useSelector(globalServices.dashboardService, offsetSelector)\n const sort = useSelector(globalServices.dashboardService, sortSelector)\n const data = useSelector(globalServices.dashboardService, dataSelector)\n\n const setSelectedCampaigns = (selectedCampaigns: RowKey[]) => send({ type: 'SET_SELECTED_CAMPAIGNS_EVENT', selectedCampaigns })\n const setOffset = (offset: number) => send({ type: 'SET_CAMPAIGNS_TABLE_OFFSET_EVENT', offset })\n const setLimit = (limit: number) => send({ type: 'SET_LIMIT_EVENT', limit })\n const setSort = (sort: SortInput[]) => send({ type: 'SET_CAMPAIGNS_TABLE_SORT_EVENT', sort })\n const handleCampaignClick = (key: RowKey) => send({ type: 'CAMPAIGN_CLICK_EVENT', selectedCampaigns: [key], tab: AttributionTableTabs.ADSETS })\n\n return (\n {\n return {\n key: id,\n name,\n status,\n spend: spend ?? undefined,\n budget: dailyBudget ?? 0,\n on: true,\n orders: orders,\n ordersValue: ordersValue,\n sourceOrders: sourceOrders,\n sourceOrdersValue: sourceOrdersValue,\n id: sourceCampaignId,\n }\n })}\n limit={limit}\n total={data?.total}\n selectedRowKeys={selectedCampaigns}\n setLimit={setLimit}\n offset={offset}\n setSort={setSort}\n setOffset={setOffset}\n setSelectedRowKeys={setSelectedCampaigns}\n />\n )\n}\n","import { useSelector } from '@xstate/react'\nimport { useContext } from 'react'\nimport { SortInput } from '../../__generated__/graphql'\nimport { GlobalStateContext } from '../../contexts/GlobalStateContext'\nimport { AttributionTableTabs, DashboardMachineState, RowKey } from '../../machines/dashboardMachine/dashboardMachine'\nimport { getColumns } from './columns'\nimport { AttributionTable } from '../AttributionTable'\n\nconst selectedAdsetsSelector = (state: DashboardMachineState) => state.context.selectedAdsets\nconst limitSelector = (state: DashboardMachineState) => state.context.limit\nconst offsetSelector = (state: DashboardMachineState) => state.context.offset.adsets\nconst sortSelector = (state: DashboardMachineState) => state.context.sort.adsets\nconst dataSelector = (state: DashboardMachineState) => state.context.data.adsetsQuery\n\nexport const AdsetsTable = () => {\n const globalServices = useContext(GlobalStateContext)\n const { send } = globalServices.dashboardService\n\n const selectedAdsets = useSelector(globalServices.dashboardService, selectedAdsetsSelector)\n const limit = useSelector(globalServices.dashboardService, limitSelector)\n const offset = useSelector(globalServices.dashboardService, offsetSelector)\n const sort = useSelector(globalServices.dashboardService, sortSelector)\n const data = useSelector(globalServices.dashboardService, dataSelector)\n\n const setSelectedAdsets = (selectedAdsets: RowKey[]) => send({ type: 'SET_SELECTED_ADSETS_EVENT', selectedAdsets })\n const setOffset = (offset: number) => send({ type: 'SET_ADSETS_TABLE_OFFSET_EVENT', offset })\n const setLimit = (limit: number) => send({ type: 'SET_LIMIT_EVENT', limit })\n const setAdsetsSort = (sort: SortInput[]) => send({ type: 'SET_ADSETS_TABLE_SORT_EVENT', sort })\n const handleAdsetClick = (key: RowKey) => send({ type: 'ADSET_CLICK_EVENT', selectedAdsets: [key], tab: AttributionTableTabs.ADS })\n\n return (\n {\n return {\n key: id,\n name,\n status,\n spend: spend ?? 0,\n budget: dailyBudget ?? 0,\n on: true,\n orders: orders,\n ordersValue: ordersValue,\n sourceOrders: sourceOrders,\n sourceOrdersValue: sourceOrdersValue,\n id: sourceAdsetId,\n }\n })}\n limit={limit}\n total={data?.total}\n selectedRowKeys={selectedAdsets}\n setLimit={setLimit}\n offset={offset}\n setSort={setAdsetsSort}\n setOffset={setOffset}\n setSelectedRowKeys={setSelectedAdsets}\n />\n )\n}\n","import { useSelector } from '@xstate/react'\nimport { useContext } from 'react'\nimport { SortInput } from '../../__generated__/graphql'\nimport { GlobalStateContext } from '../../contexts/GlobalStateContext'\nimport { DashboardMachineState, RowKey } from '../../machines/dashboardMachine/dashboardMachine'\nimport { getColumns } from './columns'\nimport { AttributionTable } from '../AttributionTable'\n\nconst selectedAdsSelector = (state: DashboardMachineState) => state.context.selectedAds\nconst limitSelector = (state: DashboardMachineState) => state.context.limit\nconst offsetSelector = (state: DashboardMachineState) => state.context.offset.ads\nconst sortSelector = (state: DashboardMachineState) => state.context.sort.ads\nconst dataSelector = (state: DashboardMachineState) => state.context.data.adsQuery\n\nexport const AdsTable = () => {\n const globalServices = useContext(GlobalStateContext)\n const { send } = globalServices.dashboardService\n\n const selectedAds = useSelector(globalServices.dashboardService, selectedAdsSelector)\n const limit = useSelector(globalServices.dashboardService, limitSelector)\n const offset = useSelector(globalServices.dashboardService, offsetSelector)\n const sort = useSelector(globalServices.dashboardService, sortSelector)\n const data = useSelector(globalServices.dashboardService, dataSelector)\n\n const setSelectedAds = (selectedAds: RowKey[]) => send({ type: 'SET_SELECTED_ADS_EVENT', selectedAds })\n const setAdsTableOffset = (offset: number) => send({ type: 'SET_ADS_TABLE_OFFSET_EVENT', offset })\n const setLimit = (limit: number) => send({ type: 'SET_LIMIT_EVENT', limit })\n const setAdsSort = (sort: SortInput[]) => send({ type: 'SET_ADS_TABLE_SORT_EVENT', sort })\n\n return (\n {\n return {\n key: id,\n name,\n status,\n spend: spend ?? 0,\n budget: spend ?? 0,\n on: true,\n orders: orders,\n ordersValue: ordersValue,\n sourceOrders: sourceOrders,\n sourceOrdersValue: sourceOrdersValue,\n id: sourceAdId,\n }\n })}\n limit={limit}\n total={data?.total}\n selectedRowKeys={selectedAds}\n setLimit={setLimit}\n offset={offset}\n setSort={setAdsSort}\n setOffset={setAdsTableOffset}\n setSelectedRowKeys={setSelectedAds}\n />\n )\n}\n","import React, { useState, useRef, useEffect } from 'react'\nimport { Input, Popover, Space } from 'antd'\nimport styled from 'styled-components'\nimport { AttributionTableTabs } from '../../machines/dashboardMachine/dashboardMachine'\nimport { SearchOption } from './SearchBar'\n\nconst StyledInput = styled(Input)`\n margin: 2px;\n min-width: 200px;\n width: fit-content;\n`\n\nconst SearchValueSpan = styled.span`\n background-color: #e6f7ff;\n color: #1890ff;\n border-radius: 4px;\n padding: 2px 6px;\n display: inline-flex;\n align-items: center;\n`\n\nconst OptionsContainer = styled.div`\n &:hover > div {\n background-color: transparent;\n }\n`\n\nconst OptionItem = styled.div<{ isActive: boolean; isDisabled: boolean }>`\n padding: 6px 10px;\n border-radius: 6px;\n cursor: ${props => (props.isDisabled ? 'not-allowed' : 'pointer')};\n pointer-events: ${props => (props.isDisabled ? 'none' : 'auto')};\n background-color: ${props => (props.isActive ? '#f5f5f5' : 'transparent')};\n opacity: ${props => (props.isDisabled ? 0.5 : 1)};\n \n &:hover {\n background-color: ${props => (props.isDisabled ? 'transparent' : '#f5f5f5')};\n }\n\n ${OptionsContainer}:hover &:hover {\n background-color: ${props => (props.isDisabled ? 'transparent' : '#f5f5f5')};\n }\n`\n\nexport interface SearchBarTag {\n key: AttributionTableTabs\n label: React.ReactNode\n value: string\n}\n\ninterface SearchSelectProps {\n options: SearchOption[]\n focus: boolean\n currentTab: AttributionTableTabs\n onFocus: () => void\n onBlur: () => void\n onSelect: (option: SearchBarTag) => void\n onBackspace: () => void\n}\n\nexport const SearchSelect = ({ options, focus, currentTab, onFocus, onBlur, onSelect, onBackspace }: SearchSelectProps) => {\n const [search, setSearch] = useState('')\n const [activeIndex, setActiveIndex] = useState(options.findIndex(option => option.key === currentTab))\n const inputRef = useRef(null)\n\n useEffect(() => {\n if (inputRef.current) {\n if (focus) inputRef.current.focus()\n else setSearch('')\n }\n }, [focus])\n\n useEffect(() => {\n setActiveIndex(options.findIndex(option => option.key === currentTab))\n }, [currentTab])\n\n const handleSearch = (e: React.ChangeEvent) => {\n const value = e.target.value\n setSearch(value)\n if (value === '') {\n setActiveIndex(options.findIndex(option => option.key === currentTab))\n }\n }\n\n const handleSelect = (option: SearchOption) => {\n onSelect({ key: option.key, label: option.label, value: search })\n setSearch('')\n }\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Backspace' && search === '') {\n onBackspace()\n } else if (event.key === 'ArrowDown') {\n event.preventDefault()\n setActiveIndex((prevIndex) => (prevIndex + 1) % options.length)\n } else if (event.key === 'ArrowUp') {\n event.preventDefault()\n setActiveIndex((prevIndex) => (prevIndex - 1 + options.length) % options.length)\n } else if (event.key === 'Enter' && search !== '') {\n event.preventDefault()\n handleSelect(options[activeIndex])\n }\n }\n\n const content = (\n \n {options.map((option, index) => (\n handleSelect(option)}\n >\n \n {option.label}\n {search && {search}}\n \n \n ))}\n \n )\n\n return (\n \n \n \n )\n}\n","import { Tag as _Tag } from 'antd'\nimport Icon, { SearchOutlined, CloseCircleFilled } from '@ant-design/icons'\nimport { useState, useCallback, useRef, useEffect } from 'react'\nimport styled from 'styled-components'\nimport { SearchBarTag, SearchSelect } from './SearchSelect'\nimport React from 'react'\nimport { AttributionTableTabs } from '../../machines/dashboardMachine/dashboardMachine'\nimport { FolderIcon } from '../../assets/dashboard_assets/ph_folder'\nimport { BrowserWindowIcon } from '../../assets/dashboard_assets/browser-window'\nimport { PromotionIcon } from '../../assets/dashboard_assets/promotion'\n\nconst SearchBarContainer = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n position: relative;\n`\n\nconst SearchBarContent = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n flex-grow: 1;\n overflow: hidden;\n`\n\nconst SearchBarInput = styled.div`\n display: flex;\n flex-wrap: wrap;\n border-radius: 4px;\n padding: 4px 8px;\n align-items: center;\n position: relative;\n flex-grow: 1;\n overflow: hidden;\n`\n\nconst Tag = styled(_Tag)`\n border: 1px solid #d9d9d9;\n padding: 4px 8px;\n display: inline-flex;\n align-items: center;\n margin: 2px;\n color: black !important;\n`\n\nconst CloseButton = styled(CloseCircleFilled)`\n cursor: pointer;\n color: rgba(0, 0, 0, 0.45);\n transition: color 0.3s;\n font-size: 12px;\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n \n &:hover {\n color: rgba(0, 0, 0, 0.75);\n }\n`\n\nexport interface SearchTerms {\n key: AttributionTableTabs\n value: string\n}\n\ninterface SearchBarProps {\n currentTab: AttributionTableTabs\n onSearch: (searchQuery: SearchTerms[]) => void\n searchTerms: SearchTerms[]\n}\n\nexport interface SearchQuery {\n campaigns: string[]\n adsets: string[]\n ads: string[]\n}\n\ninterface TagRenderProps {\n key: AttributionTableTabs\n label: React.ReactNode\n value: string\n}\n\nexport interface SearchOption {\n key: AttributionTableTabs\n label: React.ReactNode\n}\n\nconst LabelContainer = styled.span`\n display: flex;\n align-items: center;\n & svg path {\n fill: black;\n }\n`\n\nconst LabelText = styled.span`\n font-weight: bold;\n margin-left: 8px;\n`\n\nconst ContainsText = styled.span`\n color: #8c8c8c;\n margin-left: 4px;\n`\n\nconst Label = ({ Logo, type }: { Logo: () => JSX.Element; type: AttributionTableTabs }) => (\n \n } />\n {type.charAt(0).toUpperCase() + type.slice(1).toLowerCase()} name\n contains\n \n)\n\nexport const options: SearchOption[] = [\n {\n key: AttributionTableTabs.CAMPAIGNS,\n label: